Hi Aspose-Team,
in our web application, Aspose.Slides is used to process pptx-files. Aspose splits pptx-presentations and converts the slides to jpeg and pdf format.
Unfortunately, we noticed that for some slides the processing by Aspose appears to distort the formatting when converting to pdf or jpeg. As an example an image exported via microsoft power point (input.jpg) and the resulting image from the aspose convertion (output.jpeg) is attached. As you can see in this example, embedded images, bullet point and the text positions are not the same.
input.JPG (154.6 KB)
output.jpeg (551.4 KB)
Environment: We are using Java EE on Payara Application Server (GlassFish 4.1).
Code snippet we use to process files:
public void convertToPDF(InputStream is, OutputStream os) throws IOException {
Instant start = Instant.now();
LoadOptions loadOptions = new LoadOptions(); loadOptions.getBlobManagementOptions().setTemporaryFilesAllowed(true); loadOptions.getBlobManagementOptions().setMaxBlobsBytesInMemory(524288000);
Presentation p = null;
try {
p = new Presentation(is, loadOptions);
is.close();
// Set options to reduce file size of generated pdf
PdfOptions options = new PdfOptions();
options.setJpegQuality((byte) 90);
options.setBestImagesCompressionRatio(true);
for (int i = 0; i < p.getSlides().size(); i++) {
p.getSlides().get_Item(i).setHidden(false);
}
p.save(os, SaveFormat.Pdf, options);
Instant end = Instant.now();
LOGGER.finest("Succesfully converted pptx file to pdf file in " + Duration.between(start, end));
} finally {
if (p != null) {
LOGGER.finest(“Disposing presentation object relicts.”);
p.dispose();
}
}
}