ASPOSE 25.5 Chinese language data is not displaying in pdf

Hello Team,

I have a Issue with the aspose 25.5 version. When I try to generate the pdf for the english language it is created with all the data but for the same data with chinese language it is only displaying the labes and not the corresponding data of it . can you please check and suggest a solution. pfb the code attached in the zip file along with the html and pdf
aspose-v-25.zip (181.8 KB)

Regards,
Ashwin Raut

@rautashwin

Hi Ashwin,

It sounds like you’re experiencing issues with displaying Chinese characters in your PDF generated using Aspose version 25.5. This is often related to font embedding or the specific fonts used in your HTML content.

Cause: The problem may arise if the font used for Chinese characters is not available on the system where the PDF is generated, leading to incorrect rendering.

Solution: Here are a few steps to troubleshoot and resolve the issue:

  1. Font Embedding: Ensure that the fonts used in your HTML are embedded in the PDF. This is crucial for proper rendering of Chinese characters.

  2. Use a Compatible Font: Try using a font that is known to support Chinese characters, such as “SimSun” or “Arial Unicode MS”. You can set the font in your HTML or CSS.

  3. Check HTML Content: Verify that the HTML content you are converting to PDF is correctly formatted and that the Chinese characters are properly encoded (UTF-8 is recommended).

  4. Update Aspose: If possible, consider updating to a newer version of Aspose, as there may have been bug fixes or improvements related to font handling in later versions.

Here’s a minimal code snippet to set a specific font when generating the PDF:

Document pdfDocument = new Document();
DocumentBuilder builder = new DocumentBuilder(pdfDocument);
builder.Font.Name = "SimSun"; // Set to a font that supports Chinese
builder.Writeln("这里是中文内容"); // Example Chinese text
pdfDocument.Save("output.pdf");

Next Steps: If you continue to face issues, please share the specific HTML content or any error messages you are encountering. I am here to assist you further.

Let me know if this resolves your issue!

not resolved can you assign it to the relevant team. It will be a great help

@rautashwin The problem occurs because Chinese HTML here is the following unbreakable string:

www.tuvsud.com/ps-cert                                                                                                                                      

Correct this string, then the document is rendered properly.