Skip to content

Instantly share code, notes, and snippets.

@GroupDocsGists
Last active February 18, 2021 11:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GroupDocsGists/bba9bf2911d17f33dc678fb9373e6c0e to your computer and use it in GitHub Desktop.
Save GroupDocsGists/bba9bf2911d17f33dc678fb9373e6c0e to your computer and use it in GitHub Desktop.
Convert Convert Presentations to PDF in Java | PPT, PPTX, ODP, etc
// Convert consecutive slides of presentation to PDF in Java
Converter converter = new Converter("presentation.pptx");
PdfConvertOptions options = new PdfConvertOptions();
options.setPageNumber(2);
options.setPagesCount(3);
converter.convert("PptConsecutiveSlidesToPDF.pdf", options);
// Convert password protected presentation to PDF in Java
PresentationLoadOptions loadOptions = new PresentationLoadOptions();
loadOptions.setPassword("GroupDocs");
Converter converter = new Converter("presentation.pptx", loadOptions);
PdfConvertOptions options = new PdfConvertOptions();
converter.convert("pwdPptToPDF.pdf", options);
// Convert Presentations to PDF in Java using Document Conversion API
Converter converter = new Converter("presentation.pptx");
PdfConvertOptions options = new PdfConvertOptions();
converter.convert("pptxToPDF.pdf", options);
// Convert specified slides of presentation to PDF in Java
Converter converter = new Converter("presentation.pptx");
PdfConvertOptions options = new PdfConvertOptions();
options.setPages(Arrays.asList( 2, 4));
converter.convert("PptSpecificSlidesToPDF.pdf", options);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment