Skip to content

Instantly share code, notes, and snippets.

@conholdate-gists
Created March 18, 2024 20:01
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 conholdate-gists/352c55df8bf54fd16d83ed0ae62ab03e to your computer and use it in GitHub Desktop.
Save conholdate-gists/352c55df8bf54fd16d83ed0ae62ab03e to your computer and use it in GitHub Desktop.
Convert DOCX to PPTX in Java | Word DOC DOCX Document to Presentation Converter
// Load the source DOCX file
com.groupdocs.conversion.Converter converter = new com.groupdocs.conversion.Converter("sample.docx");
// Create an object of PresentationConvertOptions class
com.groupdocs.conversion.options.convert.PresentationConvertOptions options = new com.groupdocs.conversion.options.convert.PresentationConvertOptions();
// Convert Word DOCX to PPTX Presentation
converter.convert("Presentation.pptx", options);
// Load the source DOCX file
com.groupdocs.conversion.Converter converter = new com.groupdocs.conversion.Converter("sample.docx");
// Create an object of PresentationConvertOptions class
com.groupdocs.conversion.options.convert.PresentationConvertOptions options = new com.groupdocs.conversion.options.convert.PresentationConvertOptions();
// Set custom options
options.setPageNumber(2);
options.setPagesCount(1);
options.setFormat(com.groupdocs.conversion.filetypes.PresentationFileType.Pptx);
// Convert Word DOCX to PPTX Presentation
converter.convert("Presentation.pptx", options);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment