Hi,
I have a simple Word document file TestWithBarChart.docx that contains a bar chart.
TestWithBarChart.zip (21.3 KB)
When I save this document as PDF, the rendered chart in PDF clips the labels in the chart.

I used .NET Aspose.Words 25.6.0 with the following C# code to save as PDF:
string pdfFilePath = @"C:\Temp\PDF_output.pdf";
var doc = new AspWord.Document(@"C:\Temp\TestWithBarChart.docx");
doc.Save(pdfFilePath);
Can you please have a look at why the rendering is clipping the labels?
Thank you.
@llawryy
Cause
The issue of clipping labels in your bar chart when saving a Word document as a PDF arises from layout calculations during the conversion process. This can occur if the chart’s dimensions or the surrounding margins are not adequately set to accommodate the labels.
Solution
To resolve this, adjust the chart’s layout settings or the PDF save options to ensure that the labels are fully visible. Specifically, increase the size of the chart or adjust the margins in the document before saving it as a PDF.
Code
Here’s an example of how to set the PdfSaveOptions
to improve the rendering of your chart:
string pdfFilePath = @"C:\Temp\PDF_output.pdf";
var doc = new Aspose.Words.Document(@"C:\Temp\TestWithBarChart.docx");
// Create PdfSaveOptions and adjust settings if necessary
PdfSaveOptions saveOptions = new PdfSaveOptions
{
// Set compliance level if needed
Compliance = PdfCompliance.PdfA2u,
// You can also experiment with other options like downsampling images
};
// Save the document as PDF
doc.Save(pdfFilePath, saveOptions);
Next Steps
- Adjust Chart Size: Open your Word document and manually increase the size of the chart to ensure that all labels fit within the visible area.
- Check Margins: Ensure that the document margins are set appropriately to avoid clipping.
- Test Different PDF Options: Experiment with different
PdfSaveOptions
settings to see if they affect the rendering of the chart.
If you follow these steps, you should be able to resolve the clipping issue. Please let me know if you need further assistance!
Sources:
[1]: Specify Rendering Options When Converting to PDF
@llawryy
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-28416
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.
The issues you have found earlier (filed as WORDSNET-28416) have been fixed in this Aspose.Words for .NET 25.9 update also available on NuGet.