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

how to fill chinese into pdf

hi,
I want to fill chinese words in a template pdf like
(form.Fields["InsurantName"] as PdfLoadedTextBoxField).Text = "中國";
how can I do?


3 Replies

AD Administrator Syncfusion Team January 23, 2009 03:42 AM UTC

Sorry,
when I do this
(form.Fields["InsurantName"] as PdfLoadedTextBoxField).Text = "中國";
it display on screen is correct,
but print out is scramble.



BP Bhuvaneswari P Syncfusion Team January 23, 2009 10:07 AM UTC


Hi Gary,

Thank you for your interest in Syncfusion products.

I am able to reproduce the issue. You can set correct Unicode text in your form fields by setting the Overloaded Function of PdfTrueTypeFont Unicode property as true. This feature (Setting font property for form field) has been implemented only in our latest version 2009 Volume1.

Code snippet to insert Unicode text in Form fields:

//Load the template document
PdfLoadedDocument doc = new PdfLoadedDocument(@"..\..\Data\Form.pdf");

PdfLoadedForm form = doc.Form;

//Create truetype font.
Font font = new Font("Arial", 13f);

//Set as unicode to render non-unicode charaters.
PdfFont font = new PdfTrueTypeFont(fnet, true);

// fill the fields from the first page
(form.Fields[0] as PdfLoadedTextBoxField).Font = font;
(form.Fields[0] as PdfLoadedTextBoxField).Text = "中國";
doc.Save("sample.pdf");



Please download the latest version 7.1.0.21 from the below link:
http://www.syncfusion.com/support/forums/message.aspx?MessageID=79036

After modified the sample as we said, please run the sample in the latest version and let us know still you are able to reproduce the issue.

Best Regards,
Bhuvana




AD Administrator Syncfusion Team February 2, 2009 07:22 AM UTC

Hi Bhuvana,
It can print in chinese, thank you.


Loader.
Live Chat Icon For mobile
Up arrow icon