GroupDocs.Conversion provides PresentationLoadOptions to give you control over how the source presentation document will be processed. The following options could be set:
setFormat 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.
setDefaultFont sets a default font for rendering the presentation. The following font will be used if a presentation font is missing.
setFontSubstitutes sets substitute specific fonts from the source presentation document.
setPassword specifies a password to unlock the protected document.
setHideComments specifies that comments from source presentation must be hidden during conversion.
setShowHiddenSlides specifies that hidden slides should be included in the converted document.
Hide comments
The following code snippet shows how to convert a presentation and hide comments:
constloadOptions=newgroupdocs.conversion.PresentationLoadOptions()loadOptions.setHideComments(true)constoutputPath="ConvertPresentationByHidingComments.pdf"constconverter=newgroupdocs.conversion.Converter("sample.pptx",loadOptions)constconvertOptions=newgroupdocs.conversion.PdfConvertOptions()console.log(`Pdf document converted successfully to ${outputPath} (by hiding comments)`)converter.convert(outputPath,convertOptions)
Specify font substitutions
The following code snippet shows how to convert a presentation and specify font substitutions for missing fonts:
constjava=require('java')constoutputPath="ConvertPresentationBySpecifyingFontSubstitution.pdf";constfontSubstitutes=java.newInstanceSync("java.util.ArrayList");fontSubstitutes.add(groupdocs.conversion.FontSubstitute.create("Tahoma","Arial"));fontSubstitutes.add(groupdocs.conversion.FontSubstitute.create("Times New Roman","Arial"));constloadOptions=newgroupdocs.conversion.PresentationLoadOptions()loadOptions.setDefaultFont("Helvetica.ttf");loadOptions.setFontSubstitutes(fontSubstitutes);constconverter=newgroupdocs.conversion.Converter("sample.pptx",loadOptions);constconvertOptions=newgroupdocs.conversion.PdfConvertOptions();console.log(`Pdf document converted successfully to ${outputPath} (by specifying font subs)`);converter.convert(outputPath,convertOptions);
Include hidden slides
The following code snippet shows how to convert a presentation including the hidden slides:
constloadOptions=newgroupdocs.conversion.PresentationLoadOptions()loadOptions.setShowHiddenSlides(true)constoutputPath="ConvertPresentationWithHiddenSlidesIncluded.pdf"constconverter=newgroupdocs.conversion.Converter("sample.pptx",loadOptions)constconvertOptions=newgroupdocs.conversion.PdfConvertOptions()console.log(`Pdf document converted successfully to ${outputPath} (with hidden slides included)`)converter.convert(outputPath,convertOptions)
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.