Free Support Forum - aspose.com

Chinese charaters can not be displayed correctly in PDF Form field

Dear Support,
I used Aspose.Pdf.dll v18.1 to fill some fields in a pdf form. And I called the method Aspose.Pdf.Facades.Form.FillField to do this job. If the filling text is English, the result was quite fine as I expected. However if the filling text is Chinese characters (e.g. “你好”),the result would become into some unreadable boxes (e.g. □□). What is more, if I clicked on the boxes in the field, these Chinese characters boxes would be displayed correclty immediately.

Please note that this issue would happen, if I do this job on an English Windows OS. As a contrast, filling Chinese characters on an Chinese Windows OS would work fine.

My sample code is quite like this:
//load license
Aspose.Pdf.Facades.Form form = new Aspose.Pdf.Facades.Form(src.pdf);
form.FillField(“Text2”,“你好”);
form.Save(dst.pdf);

Could you help me to get rid of this boring issue?
Thank you in advance.

@OceanX

Can you please share your PDF file so that we can try to reproduce it on our end. Hopefully the issue is related to fonts and may be fixed if you try to install required fonts.

Dear Support,
Thank you for your quick response.
I have attached the sample pdf file I for your testing.
I also guess that this issue has something to do with the OS’s fonts, but I can not go
further.
Aspose_sample.zip (185 KB)

@OceanX

I have tested your code and file in English Windows OS but the issue is not reproduced. I request you to install the fonts being used in this PDF file and share your feedback. Fonts.PNG (5.4 KB)
dst.pdf (124.9 KB)

Dear Support,
I have investigated the dst.pdf you sent me and find that there is a font ‘MSGothic (Embedded Subset)’ in it which does not exist in my erroneous pdf.
So, I wonder how can I let my pdf has a font ‘MSGothic (Embedded Subset)’ on my English Windows OS as yours.

@OceanX

Please install MSGothic on your system and then share your feedback. The PDF will automatically pick a suitable font on your OS.