Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Sat Jan 07, 2023 10:29 am

I am using spire.pdf dll and have a project which use bilingual when i convert image to pdf the text is wrong
First Photo is original.
Second is pdf
any suggestions.
thanks.

qaissabbah
 
Posts: 2
Joined: Sat Jan 07, 2023 8:58 am

Mon Jan 09, 2023 5:56 am

Hi,

Thanks for your inquiry.
I tested your first photo named PDF.JPG with Spire.PDF_9.1.0, using the following code,
Code: Select all
            // Create a pdf document with a section and page added.
            PdfDocument pdf = new PdfDocument();
            PdfSection section = pdf.Sections.Add();
            PdfPageBase page = pdf.Pages.Add();

            //Load a image from system
            PdfImage image = PdfImage.FromFile("Pdf.JPG");
            //Set image display location and size in PDF
            //Calculate rate
            float widthFitRate = image.PhysicalDimension.Width / page.Canvas.ClientSize.Width;
            float heightFitRate = image.PhysicalDimension.Height / page.Canvas.ClientSize.Height;
            float fitRate = Math.Max(widthFitRate, heightFitRate);
            //Calculate the size of image
            float fitWidth = image.PhysicalDimension.Width / fitRate;
            float fitHeight = image.PhysicalDimension.Height / fitRate;
            //Draw image
            page.Canvas.DrawImage(image, 0, 30, fitWidth, fitHeight);

            string output = "output.pdf";

            pdf.SaveToFile(output);
            pdf.Close();

but I did not reproduce your issue, you can see my output file in the attachment. To help us do a further investigation for you, could you please provide us with the following messages? You can send them to us via email ([email protected]) or attach them here. Thanks for your assistance in advance.
1) your full code that can reproduce your issue.
2) the version of Spire.PDF in your project.
3) your application type, such as Console App .NET Framework 4.8.
4) your test environment, such as OS info (E.g., Windows 10 64 bit) and region setting (E.g., China, Chinese).

Sincerely,
Triste
E-iceblue support team
User avatar

Triste.Dai
 
Posts: 1000
Joined: Tue Nov 15, 2022 3:59 am

Mon Jan 09, 2023 7:00 am

Thanks for your reply.
As you can see , the original image has text C0000016 معجنات السلطان
but output the text is reversed معجنات السلطان C0000016

qaissabbah
 
Posts: 2
Joined: Sat Jan 07, 2023 8:58 am

Mon Jan 09, 2023 8:54 am

Hi,

Thanks for your feedback.
Could you please provide us with the following messages to help us do a further investigation? You can send them to us via email ([email protected]) or attach them here. Thanks for you assistance.
1) your full code and input image that can reproduce your issue.
2) the version of Spire.PDF in your project.
3) your application type, such as Console App .NET Framework 4.8.
4) your test environment, such as OS info (E.g., Windows 10 64 bit) and region setting (E.g., China, Chinese).

Sincerely,
Triste
E-iceblue support team.
User avatar

Triste.Dai
 
Posts: 1000
Joined: Tue Nov 15, 2022 3:59 am

Return to Spire.PDF

cron