The GroupDocs.Conversion for Java library allows developers to load presentation files such as PPT, PPTX, and other formats into their applications with precise control over the loading process through customizable PresentationLoadOptions. This functionality supports advanced scenarios, including specifying slide numbers, handling hidden slides, or managing password-protected presentations.
The process involves initializing the Converter class with the presentation file’s path or stream. By defining specific properties in the PresentationLoadOptions, users can, for instance, load only selected slides or ensure compatibility with particular format variations. Once loaded, the document is ready for seamless conversion into any supported output format while maintaining high fidelity and preserving the source layout.
This approach is ideal for workflows involving large-scale presentation processing, batch conversions, or integrating document handling in server-side Java applications. For this the following options could be set:
allows you to specify explicitly the type of the source presentation document. Available options are: Ppt, Pps, Pptx, Ppsx, Odp, Otp, Potx, Pot, Potm, Pptm, Ppsm.
sample.pptx is sample file used in this example. Click here to download it.
converted_without_comments.pdf is converted PDF document. Click here to download it.
Specify font substitutions
The following code snippet shows how to convert a presentation and specify font substitutions for missing fonts:
importcom.groupdocs.conversion.Converter;importcom.groupdocs.conversion.contracts.FontSubstitute;importcom.groupdocs.conversion.options.convert.PdfConvertOptions;importcom.groupdocs.conversion.options.load.PresentationLoadOptions;importjava.util.ArrayList;importjava.util.List;publicclassConvertPresentationBySpecifyingFontSubstitution{publicstaticvoidconvert(){PresentationLoadOptionsloadOptions=newPresentationLoadOptions();List<FontSubstitute>fontSubstitutes=newArrayList<FontSubstitute>();fontSubstitutes.add(FontSubstitute.create("Tahoma","Arial"));fontSubstitutes.add(FontSubstitute.create("Times New Roman","Arial"));loadOptions.setFontSubstitutes(fontSubstitutes);try(Converterconverter=newConverter("sample.pptx",()->loadOptions)){PdfConvertOptionsoptions=newPdfConvertOptions();converter.convert("converted_with_substitutes.pdf",options);}}publicstaticvoidmain(String[]args){convert();}}
sample.pptx is sample file used in this example. Click here to download it.
converted_with_substitutes.pdf is converted PDF document. Click here to download it.
Include hidden slides
The following code snippet shows how to convert a presentation including the hidden slides: