Unable to generate PDF with Chinese characters

We are using Aspose PDF to convert html to PDF. When we try to generate a pdf with 㐐 㐠 㐰 㑀 㑐 㑠 㑰 㒀 㒐 㒠 㒰 㓀 㓐 㓠 㓰 it is not generating pdf correctly.


We are using Aspose document model.

Is there any update?

Attaching HTML input and PDF output

Hi there,

Thanks for your inquiry. I have tested your shared HTML using Aspose.Pdf for .NET 10.5.0 and managed to observe the reported issue. For further investigation, I have logged an issue in our issue tracking system as PDFNEWNET-39002 and also linked your request to it. We will keep you updated via this thread regarding the issue status.

Please feel free to contact us for any further assistance.

<span style=“font-size:10.0pt;font-family:“Arial”,“sans-serif”;mso-fareast-font-family:
Calibri;color:#333333;mso-ansi-language:EN-US;mso-fareast-language:EN-US;
mso-bidi-language:AR-SA”>Best Regards

Hi there,


Is there any update on when the issue will be fixed? It is currently a major issue for us.

Thanks,
Akshay
Hi Akshay,

Thanks for your inquiry. W have recently logged the reported issue and it is still pending for investigation due to other issues, already under investigation and resolution. We will notify you as soon as we made some progress towards issue resolution.

We are sorry for the inconvenience caused.

Best Regards,

Hi There,

Is there any update on this ticket [PDFNEWNET-39002]. We are currently blocked and are not able to use unicode characters in PDF.

Any ideas when the fix will be available?

Thanks, -Askhay

Hi Akshay,

Thanks for your patience.

The earlier reported issue is still pending for review and I am afraid its not yet resolved. However I have shared your concerns with product team and as soon as we have some further updates, we will let you know.

Hi,


has there been any movement on this issue? Are there any workarounds available to get Chinese characters to appear in PDF?

Hi David,


Thanks for contacting support.

I am afraid the earlier reported issue is not yet resolved. However the earlier reported issue is logged against specific HTML file and in case you have some different scenario, please share the input document, so that we can test the scenario and share our findings. We apologize for your inconvenience.

Hi,


Thanks for your quick response.

The example I am using is the table below. The characters in ‘Arial’ font don’t appear in the PDF, but the ones in ‘Arial Unicode MS’ do. In my real examples the Chinese characters can be mixed with English so I can’t change the font overall.

Arial Arial Unicode MS
A A
B B
C 西 C 西

Hi David,


Thanks for sharing further details.

I am looking into in detail. I will share my findings with you shortly.

We are sorry for the inconvenience.

Best Regards,

Hi,


we have found the following setting allows it to work. It works for the most common languages in our app. We didn’t need to change anything else.

Pdf pdf = new PDF();
pdf.IsAutoFontAdjusted = true;

Hi David,


I have tested the scenario with following code snippet using Aspose.Pdf for JAVA 17.3.0 on MAC OS and have managed to export HTML file to PDF successfully. I have also attached the PDF file for your reference.

JAVA

<span style=“background-color: rgb(255, 255, 255); font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre;”>HtmlLoadOptions htmloptions = <span class=“kwrd” style=“font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre;”>new<span style=“background-color: rgb(255, 255, 255); font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre;”> HtmlLoadOptions(dataDir);
Document doc = new Document(dataDir + “test.html”, htmloptions);
doc.save(dataDir + “htmltopdf.pdf”);

If you still face any issues, please share your environment details to reproduce the issue on our end.

We are sorry for this inconvenience.

Best Regards,
davidpi:
Hi,

we have found the following setting allows it to work. It works for the most common languages in our app. We didn't need to change anything else.

Pdf pdf = new PDF();
pdf.IsAutoFontAdjusted = true;
Hi David,

Thanks for contacting support.

Adding more to Fahad's comments, it appears that you are using legacy aspose.pdf.generator approach for HTML to PDF conversion. However as suggested by Fahad, please try using new DOM approach.

The issues you have found earlier (filed as PDFNET-39002) have been fixed in Aspose.PDF for .NET 24.1.