Load Presentation document with options

GroupDocs.Conversion provides PresentationLoadOptions to give you control over how Microsoft PowerPoint or Open Document presentation will be converted into target format. The following options could be set:

  • Format - the document type is auto detected during loading, however you can specify explicitly the type of the source presentation document. Available options are: Ppt, Pps, Pptx, Ppsx, Odp, Otp, Potx, Pot, Potm, Pptm, Ppsm
  • DefaultFont - default font for rendering the presentation. The following font will be used if a presentation font is missing.
  • FontSubstitutes - substitute specific fonts from the source presentation document
  • Password -  password to unlock protected document
  • HideComments - specifies that comments from source presentation must be hidden during conversion
  • ShowHiddenSlides - specifies that hidden slides should be included in converted document

Hide comments

Like many other Microsoft Office applications PowerPoint provides “Comments” feature to simplify the presentation review. By default Comments pane will be present in a converted document. In case you want to hide comments set HideComments to *true *as shown in a code sample below:

Contracts.Func<LoadOptions> getLoadOptions = () => new PresentationLoadOptions
{
    HideComments = true
};
using (Converter converter = new Converter("sample.pptx", getLoadOptions))
{
    PdfConvertOptions options = new PdfConvertOptions();
    converter.Convert("converted.pdf", options);
}

Specify font substitutions

Original PowerPoint presentations may use some specific and non-standard fonts for text formatting that are not available at the time of conversion. GroupDocs.Conversion for .NET allows you to provide substitutions for missing fonts by setting FontSubstitues collection with original/substitute font pairs.

The following code sample shows how to convert PPTX presentation and specify substitutions for missing fonts:

Contracts.Func<LoadOptions> getLoadOptions = () => new PresentationLoadOptions
{
    DefaultFont = "Helvetica",
    FontSubstitutes = new List<FontSubstitute>
    {
       FontSubstitute.Create("Tahoma", "Arial"),
       FontSubstitute.Create("Times New Roman", "Arial"),
    }
};
using (Converter converter = new Converter("sample.pptx", getLoadOptions))
{
    PdfConvertOptions options = new PdfConvertOptions();
    converter.Convert("converted.pdf", options);
}

Include hidden slides

Just like you are able to show or hide slides in a Microsoft PowerPoint presentation manually, GroupDocs.Conversion for .NET allows to display hidden slides in a converted document programmatically (by default all hidden slides are excluded from converted document). You just have to set ShowHiddenSlides property to true.

The following code sample shows how to convert PPTX presentation including the hidden slides:

Contracts.Func<LoadOptions> getLoadOptions = () => new PresentationLoadOptions
{
    ShowHiddenSlides = true
};
using (Converter converter = new Converter("sample.pptx", getLoadOptions))
{
    PdfConvertOptions options = new PdfConvertOptions();
    converter.Convert("converted.pdf", options);
}

More resources

Examples and Demos

Please find more use-cases and complete C# sources of our backend and frontend examples and try them for free!