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 the target format. The following options could be set:

OptionDescription
FormatThe 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
DefaultFontA default font for rendering the presentation. The following font will be used if a presentation font is missing.
FontSubstitutesSubstitute specific fonts from the source presentation document.
HideComments Specifies that comments from source presentation must be hidden during conversion
Password A password to unlock the protected document
ShowHiddenSlides Specifies that hidden slides should be included in the converted document
SkipExternalResourcesIf enabled, the external resources (except for those listed in WhitelistedResources) will not be loaded during the conversion.
WhitelistedResourcesSpecifies which external resources will be loaded even when the loading of other external resources is restricted.

Hide comments

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

With v24.10 and later:

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

Before v24.10:

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 the FontSubstitues collection with original/substitute font pairs.

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

With v24.10 and later:

Func<LoadContext, LoadOptions> getLoadOptions = loadContext => 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);
}

Before v24.10:

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 can show or hide slides in a Microsoft PowerPoint presentation manually, GroupDocs.Conversion for .NET allows displaying of the hidden slides in the converted document programmatically (by default all hidden slides are excluded from the converted document). You just have to set the ShowHiddenSlides property to true.

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

With v24.10 and later:

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

Before v24.10:

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

Skip loading of external resources

In the context of presentations, external resources typically refer to elements or materials that are not directly embedded within the presentation file itself but are instead referenced or linked to enhance the presentation’s content or functionality. These external resources can include various types of content and tools that complement the presentation. Common external resources include images, audio, video, fonts, styles, data sources, and so on.

In some cases, you may want to skip loading all or just some of the external resources during the conversion. For example, when these resources become unavailable. Read the Skip loading of external resources article to learn how to do this with GroupDocs.Conversion for .NET