Aspose Words DOCX to PDF conversion: bullet points are not rendering in the Linux environment

Hi Team,

When, I am uploading Word documents with bullet points, they are not rendering properly in the Linux environment. The bullets appear as squares. see attached snap.

Currently, the following font packages are installed in the Linux environment:

  • ttf-mscorefonts-installer
  • fonts-dejavu-core
  • fonts-opensymbol

We are limited to font packages that can be installed on a debian linux box.

After installing the fonts, the bullets are displaying as squares.

Code snippet:

Any suggestions or additional information on this issue would be greatly appreciated. Thanks in advance!

@RakeshI3

It sounds like you’re experiencing issues with bullet points not rendering correctly in your PDF conversion on a Linux environment, where they appear as squares. This is often related to missing or incompatible font support.

Cause: The problem is likely due to missing fonts that support the bullet characters or incorrect font embedding in your Word documents.

Solution: Here are some steps you can take to resolve this issue:

  1. Install Additional Fonts: The fonts you currently have may not support the bullet characters. Consider installing additional font packages that include comprehensive character sets, such as fonts-liberation or fonts-noto. These fonts are often more compatible with various document formats.

  2. Check Font Embedding: Ensure that the fonts used in your Word documents are embedded correctly. You can check this in Word by going to File > Options > Save and ensuring that “Embed fonts in the file” is checked.

  3. Use a Different Conversion Method: If you’re using a specific method for conversion, try using a different approach or library version. Sometimes, updating to the latest version of Aspose.Words can resolve rendering issues.

  4. Test with Different Documents: Try converting a simple document with bullet points to see if the issue persists. This can help determine if the problem is document-specific.

  5. Review Your Code: Ensure that your code for conversion is set up correctly. Here’s a basic example of how to convert a DOCX file to PDF using Aspose.Words:

    Document doc = new Document("input.docx");
    doc.Save("output.pdf");
    

Next Steps: If you follow these steps and still encounter issues, please provide more details about your code and the specific bullet points used in your documents. This information will help in diagnosing the problem more effectively.

Let me know if this resolves your issue!

Hi,

I added fonts-liberation and fonts-noto to the startup command in Stage, but unfortunately that didn’t resolve the issue. The squares are still shown instead of the bullets.

  • I played around with the settings related to font embedding, but this also didn’t work. Here’s what I’m seeing:

a. If I use the default embedding settings, then there is no change in the converted PDF.

b. If I uncheck “Do not embed common system fonts” then additional characters are not rendered correctly in the converted PDF.

c. The “Embed only the characters used in the document” option doesn’t appear to have any impact.

d. Enabling the font embedding while including system fonts changes the file size of an 84 KB file to a 5,582 KB file. Using the option to only embed the characters used drops that down to 2,393 KB. However, this file size increase is significant, so I don’t think we could realistically expect customers to turn this on.

I am using latest Aspose library which is Version=“25.6.0”.

Thanks.

@RakeshI3

It looks like the scenario in related to Aspose.Words. We are moving this thread to the respective category where you will be assisted shortly.

@RakeshI3 Could you please attach your actual input and problematic output documents here for testing? We will check the issue and provide you more information.

The problem might occur due to the known peculiarity - Windows “Symbol” font (which is used for bullets) is a symbolic font (like “Webdings”, “Wingdings”, etc.) which uses Unicode PUA. MacOS or Linux “Symbol” font on the other hand is a proper Unicode font (for example Greek characters are in the U+0370…U+03FF Greek and Coptic block). So these fonts are incompatible and Mac/Linux “Symbol” font cannot be used instead of Windows “Symbol” without additional actions. In your particular case, it looks like, the bullet is represented as U+2022, but in Windows “Symbol” it is PUA U+F0B7 (or U+00B7 which also can be used in MS Word for symbolic fonts). So if you use Linux or Mac version of Symbol font, you should change U+2022 character to U+00B7:

Document doc = new Document(@"C:\Temp\in.docx");

List<Run> items = doc.GetChildNodes(NodeType.Run, true).Cast<Run>()
    .Where(r => r.Font.Name == "Symbol").ToList();

foreach (Run r in items)
{
    if (r.Text == "\x2022")
        r.Text = "\x00b7";
}

doc.Save(@"C:\Temp\out.pdf");

But the simplest way to resolve the problem is installing Windows Symbol font.

Hi,

Attached here is the actual input document.

TestBulletFont.docx (38.5 KB)

And problematic output document

Thanks.

@RakeshI3 Thank you for additional information. The problem is not reproducible on my side. Here is PDF document produced on my side:
out.pdf (15.2 KB)

If possible, could you please attach your actual problematic output document? Unfortunately, screenshots do not give enough information for analysis.

Hi,

Please find attached the actual problematic document.

a848788d-4e17-43ef-9417-0d8f6084b2c7.pdf (148.2 KB)

Thanks

@RakeshI3 As I can see in your document OpenSymbol font is used. But MS Word uses Symbol font for rendering bullets.

You should not that the difference in rendering might occur because the required fonts are not available on your side. The fonts are required to build document layout. If Aspose.Words cannot find the font used in the document, the font is substituted . This might lead into fonts mismatch and document layout differences due to the different fonts metrics. You can implement IWarningCallback to get notifications when font substitution is performed.
Please see our documentation to learn where Aspose.Words looks for fonts:
https://docs.aspose.com/words/net/specifying-truetype-fonts-location/