PPTX to PDF: Improper bullets and fonts rendering (Java WebApp)

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();

}

}

}

@agbmw,

I have observed the images shared by you. It seems to be issue of missing fonts for text and bullets used in your presentation. You need to make sure that fonts used in your presentation should be installed on machine where you are performing rendering. I suggest you to please try using Aspose.Slides for Java 20.2 on your end. If there is still an issue then please share the working sample code along with source file and generated PDF with us. Moreover, I also suggest you to please export presentation to PDF in console based Java project on your end to see if there is any rendering issue incurring or not.