We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Unicode text in PDF

Hi,

I'm evaluating the PDF component for use in a project. It is required to produce PDF files with unicode text which can be mixed from different cultures. 

I made an example test which gave me the following issues compared to a standard text box display in Windows 10:

  • ·        Israelian names were rendered left to right (instead of right to left)
  • ·    Arabic names were rendered left to right (instead of right to left)
  • ·    Japanese names were not rendered

Full documentation can be found in the attached file.

What can I do to get the correct rendering in the pdf?

Thanks in advance.


Attachment: syncfusion_unicode_pdf_issues_f41878ec.zip

3 Replies

CM Chinnu Muniyappan Syncfusion Team April 3, 2017 09:59 AM UTC

Hi Uwe, 
 
Thank you for contacting Syncfusion support. 
 
At present, we do not support to create a multi lingual appearance dictionary using a single font for the form fields. So, we suggest you to set the default appearance to true, to enable the reader’s (Adobe reader) self-appearance dictionary to render the text as expected. Please refer the below code snippet and sample for more details. 
 
            //Create a new PDF document 
            PdfDocument doc = new PdfDocument(); 
 
            //Add new PDF page 
            PdfPage page = doc.Pages.Add(); 
 
            //Create a new PDF text box field 
            PdfTextBoxField tBox = new PdfTextBoxField(page, "text1"); 
 
            //Set the location 
            tBox.Bounds = new RectangleF(0, 0, 500, 40); 
 
            tBox.Font = new PdfTrueTypeFont(new Font("Segoe UI", 12, FontStyle.Regular), true); 
 
            //Set the multiline 
            tBox.Multiline = true; 
 
            //Set the text 
            tBox.Text = "??? ????'?? ?'??? {he-IL};??? ?????? ???? {he-IL};???????? ???? {ar-SA};?????·???·???? {ja-JP};??????????? {ja-JP};???·?????·???·???? {ja-JP}"; 
 
            //Enable the default appearance of the form 
            doc.Form.SetDefaultAppearance(true); 
 
            //Add the textbox field 
            doc.Form.Fields.Add(tBox); 
 
            //Save the document 
            doc.Save("output.pdf"); 
 
            //Close the document 
            doc.Close(true); 
 
Sample Link: 
 
Please let us know if you have any concern. 
 
Regards, 
Chinnu 



UF Uwe Fritsche April 4, 2017 02:35 PM UTC

Hi Chinnu,

thanks for the quick reply. I think the PDF documents should always look same - not depending the viewer application.

In the meantime I tried using the DocIO component, it is not able handling the problem too.

So I'll look forward for future updates of your PDF component. I think multi lingual text should be handled internally by the PDF component.

Regards,
Uwe


CM Chinnu Muniyappan Syncfusion Team April 5, 2017 11:25 AM UTC

Hi Uwe, 
 
Thank you for your update. 
 
As we said earlier, at present, we do not have support for creating a multilingual font appearance dictionary in PDF form fields, so we have logged a feature request for Need to add the multilingual font support for PDF text box fields. We will implement this feature in any of our upcoming releases. We usually have an interval of at least three months between releases. The feature implementation would also greatly depend on the factors such as product design, code compatibility and complexity. Please log on to our support website to check for further updates:  
  
  
Please let us know if you need further assistance.  
  
Regards,  
Chinnu 


Loader.
Up arrow icon