Convert PDF to PowerPoint in Java

Aspose.PDF for Java supports exporting PDF pages into editable PowerPoint presentations with slide rendering options. Use PptxSaveOptions to control how PDF pages are mapped into PowerPoint slides.

Convert PDF to PPTX

Use this example when a PDF document should be exported as a standard PowerPoint presentation.

  1. Open the source PDF in a Document instance.
  2. Create default PptxSaveOptions for editable PowerPoint export.
  3. Call document.save(outputFile.toString(), saveOptions) so the PDF pages are serialized as a .pptx presentation.
  4. Save the converted PPTX file.
public static void convertPdfToPptx(Path inputFile, Path outputFile) {
    try (Document document = new Document(inputFile.toString())) {
        PptxSaveOptions saveOptions = new PptxSaveOptions();
        document.save(outputFile.toString(), saveOptions);
    }
    System.out.println(inputFile + " converted into " + outputFile);
}

Convert PDF to PPTX with slides as images

Use this example when each PDF page should become an image-based PowerPoint slide.

  1. Open the source PDF in a Document instance.
  2. Create PptxSaveOptions and enable setSlidesAsImages(true).
  3. Call document.save(outputFile.toString(), saveOptions) so each PDF page is rendered as an image-backed slide in the presentation.
  4. Save the generated PPTX file.
public static void convertPdfToPptxSlidesAsImages(Path inputFile, Path outputFile) {
    try (Document document = new Document(inputFile.toString())) {
        PptxSaveOptions saveOptions = new PptxSaveOptions();
        saveOptions.setSlidesAsImages(true);
        document.save(outputFile.toString(), saveOptions);
    }
    System.out.println(inputFile + " converted into " + outputFile);
}

Convert PDF to PPTX with custom image resolution

Use this example when the slide image quality should be controlled during PDF-to-PPTX export.

  1. Open the source PDF in a Document instance.
  2. Create PptxSaveOptions and set setImageResolution(300) for higher slide image fidelity.
  3. Call document.save(outputFile.toString(), saveOptions) so rasterized slide content is generated at the requested resolution.
  4. Save the output presentation.
public static void convertPdfToPptxImageResolution(Path inputFile, Path outputFile) {
    try (Document document = new Document(inputFile.toString())) {
        PptxSaveOptions saveOptions = new PptxSaveOptions();
        saveOptions.setImageResolution(300);
        document.save(outputFile.toString(), saveOptions);
    }
    System.out.println(inputFile + " converted into " + outputFile);
}