We are trying convert PPT document into PDF. But, charts from ppt are not rendered correctly in PDF.
In PDF chart images got distorted dramatically.
Java Version :17
We are using aspose.slides version 24.7
Linux version : 4.18.0-553.22.1.el8_10.x86_64 #1 SMP Wed Sep 11 18:02:00 EDT 2024 x86_64 x86_64 x86_64 GNU/Linux
Attached PPT file here along with few sample images of affected charts from pdf.
please suggest.
File pptFile = new File("pptFilePath");
try (FileInputStream fileInputStream = new FileInputStream(pptFile)) {
logger.info("initilizatize fileInputStream for the ppt document");
Presentation ppt = new Presentation(fileInputStream);
logger.info("initilizatize presensentation object");
ppt.getDocumentProperties().setTitle("SampleTitle");
ppt.save(outputPdfFilePath,SaveFormat.Pdf,pdfOptions); //This ppt.save method takes more 5 mins to execute.
}
catch (Exception e) {
//
}
It seems you are experiencing issues with chart rendering when converting a PowerPoint presentation to PDF using Aspose.Slides. Distorted charts can often be attributed to various factors, including the complexity of the charts, the version of Aspose.Slides being used, or specific settings in the conversion process.
Here are a few suggestions to help you troubleshoot and potentially resolve the issue:
Update Aspose.Slides: Ensure you are using the latest version of Aspose.Slides. As of your current version (24.7), there may have been updates or bug fixes in later versions that address chart rendering issues.
Check Chart Types: Some chart types may have specific rendering issues. If possible, try simplifying the charts or using different types to see if the problem persists.
Adjust PDF Options: When saving the presentation to PDF, you can customize the PdfOptions to improve the output quality. For example, you can set the JpegQuality or TextCompression properties to enhance the rendering of charts.
Here’s an example of how to set PDF options:
PdfOptions pdfOptions = new PdfOptions();
pdfOptions.setJpegQuality(100); // Set JPEG quality to maximum
pdfOptions.setTextCompression(TextCompression.Flate); // Use Flate compression for text
ppt.save(outputPdfFilePath, SaveFormat.Pdf, pdfOptions);
Validate Chart Layout: Before saving the presentation, you can validate the layout of the charts to ensure they are rendered correctly. This can be done using the ValidateChartLayout method.
Example:
for (ISlide slide : ppt.getSlides()) {
for (IShape shape : slide.getShapes()) {
if (shape instanceof IChart) {
((IChart) shape).validateChartLayout();
}
}
}
Test on Different Environments: Since you are using Linux, it might be worth testing the conversion on a different operating system (like Windows) to see if the issue is environment-specific.
Review Sample Files: If you have access to other PPT files with charts that render correctly, compare them with the problematic file to identify any differences in chart configuration.
If the issue persists after trying these suggestions, consider reaching out to Aspose support with detailed information about the charts and the specific problems you are encountering. Providing sample files can also help in diagnosing the issue more effectively.
Feel free to ask if you have any further questions or need additional assistance!
@forasposeissues,
I’ve reproduced the problem with the charts when converting the PowerPoint presentation to a PDF document.
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): SLIDESJAVA-39640
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 found earlier (filed as SLIDESJAVA-39640) have been resolved in Aspose.Slides for Java 25.4 (Maven, JAR).
You can check all fixes on the Release Notes page.
You can also find the latest version of our library on the Product Download page.
Please find the summary of test evidence with PPTX file shared with you previous Thread. We have noticed that some slide is not getting properly after applying fix (aspose.slides 25.4) Summary_pptx_to_pdf.docx (3.8 MB)
@forasposeissues,
Thank you for the message. I’ve carefully reviewed the issues you described in the DOCX file. Regarding the slides mentioned in the document, the issues are not visible in the screenshots and are not reproduced with Aspose.Slides for Java 25.4.
@forasposeissues,
Could you please have your QA team point out the issues they found? It would be great if they could highlight the issues in the screenshots.
Regarding slide 4, I was unable to reproduce the issue. Please verify carefully that you are actually using Aspose.Slides 25.4.
Regarding slides 9, 28, and 39, please note that the Citi Sans Text font is used in the presentation, but a different font appears in the PDF. This occurs because Citi Sans Text is missing from the operating system where the conversion was performed. This may also affect text placement. To resolve this, you should either install the font on the operating system or load it as an external font using the FontsLoader class, as shown below:
var folders = new String[] { "path_to_a_folder_with_fonts" };
FontsLoader.loadExternalFonts(folders);
Regarding slide 36, I have reproduced the issue. 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): SLIDESJAVA-39701
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.
@forasposeissues,
In PowerPoint on my side, the X-axis labels on slide 4 look the same as in your screenshot of page 4 of the PDF (0, 2, 4,… 16). Also, you can upload the presentation to Office 365 and view it. It appears that PowerPoint renders slide 4 differently on your end.
The issues you found earlier (filed as SLIDESJAVA-39701) have been resolved in Aspose.Slides for Java 25.9 (Maven, JAR).
You can check all fixes on the Release Notes page.
You can also find the latest version of our library on the Product Download page.