Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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