When converting from PPTX to PDF with notes, there are two issues.
Firstly, we are seeing warnings reported by Aspose (see screenshot below), however it does translate the file.
Secondly, the slides are not resized to fit the notes page area. However, if the paper size is not set to be A4, the slides are resized.
Here’s the code:
public static void convertPPTX2PDF(String inputPath, String outputPath) throws Exception {
try {
com.aspose.slides.Presentation presentation = new com.aspose.slides.Presentation(inputPath);
Warnings reported by Aspose when converting a pptx to pdf: image.png (8.2 KB)
The presentation slide has not been resized to fit the notes page when setting it to be A4 (the screenshot on the left is the PDF created by Aspose and the PDF on the right is created by doing a print to PDF in PowerPoint): image.png (26.7 KB)
The problem lies in following statement where you have changed the slide size and have choose the option Do not scale. By doing so, you are telling API to change the slide size and shapes will not be scaled with respect to new slide size and they should remain as original. You need to scale the shapes here as well.
For your other issue concerning to warnings, please share the Java and Operating System details on your end.
We have changed the code from:
presentation.getSlideSize().setSize(SlideSizeType.A4Paper, SlideSizeScaleType.DoNotScale);
To:
presentation.getSlideSize().setSize(SlideSizeType.A4Paper, SlideSizeScaleType.EnsureFit);
and it now works - thank you for your help.
It’s good to know that suggested option has worked on your end.
For issue regarding warnings appearing when rendering slides, a ticket with ID SLIDESJAVA-38373 has been created in our issue tracking system to further investigate and resolve the issue. This thread has been linked with the issue so that you may be notified once the issue will be addressed.