Charts have wrong axis labels when converting from DOCX to PDF

Hi,

When converting a DOCX to PDF, I noticed some x-axis labels in some charts are wrongly rendered.

Code:

var doc = new Document(@".\test.docx");
doc.Save(@".\out.pdf", new PdfSaveOptions());

I’ve attached the test files and a screenshot for your reference. Could you please help check?

test.zip (82.3 KB)

Thanks,

@ServerSide527

It seems you are experiencing issues with incorrect x-axis labels in charts when converting a DOCX document to PDF using Aspose.Words. This can sometimes occur due to the complexity of the PDF format and how Aspose.Words handles the rendering of charts and their elements.

To address this issue, you can try the following steps:

  1. Update Aspose.Words: Ensure you are using the latest version of Aspose.Words, as updates often include bug fixes and improvements related to document conversion.

  2. Specify Rendering Options: You can customize the rendering options when saving to PDF. The PdfSaveOptions class allows you to set various properties that might help improve the output. For example, you can try adjusting the EmbedFullFonts property to ensure that all fonts are embedded correctly, which can sometimes affect how text is rendered in charts.

    Here’s a sample code snippet to illustrate how to set these options:

    var doc = new Document(@".\test.docx");
    PdfSaveOptions saveOptions = new PdfSaveOptions
    {
        EmbedFullFonts = true // Ensure all fonts are embedded
    };
    doc.Save(@".\out.pdf", saveOptions);
    
  3. Check Chart Data: Verify that the data used in the charts is correctly formatted in the DOCX file. Sometimes, issues can arise from the data itself rather than the conversion process.

  4. Review Output Settings: If the problem persists, consider experimenting with other properties of PdfSaveOptions, such as Compliance, to see if different settings yield better results.

If these suggestions do not resolve the issue, please consider sharing more details about the specific charts and their configurations, as well as any error messages you might be encountering. This information can help in diagnosing the problem more effectively.

For further assistance, you may also want to check the official documentation on rendering options when converting to PDF, which provides additional insights into how to manage the conversion process effectively.

If you continue to face challenges, feel free to reach out with your test files and screenshots, as they can provide valuable context for troubleshooting.

Sources:
[1]: Options When Converting to PDF|Aspose.Words for .NET

@ServerSide527
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): WORDSNET-28227

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.