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.
CommentsPosition Specifies where comments are printed with each slide: None (default, comments are not printed), Bottom, or Right.
Password A password to unlock the protected document
ShowHiddenSlides Specifies that hidden slides should be included in the converted document
ExternalResourceHandlerA handler called for each resource the document asks to load; it can allow the resource, skip it or supply its content. Default: null. Available since version 26.10.
SkipExternalResourcesWhether to skip the external resources the document references. Default: true. Content the document carries, local files inside its folder and resources that match WhitelistedResources still load.
WhitelistedResourcesAbsolute URI prefixes, such as https://cdn.example.com/assets/, of external resources to load while SkipExternalResources is true. Since version 26.10, an entry that is not an absolute URI prefix makes the load fail with InvalidLoadOptionsException.

Show or hide comments

Like many other Microsoft Office applications PowerPoint provides the “Comments” feature to simplify the presentation review. By default, comments are not included in a converted document. The CommentsPosition property controls this: PresentationCommentsPosition.None (the default) hides comments, while Bottom or Right prints them below or to the right of each slide. To print comments to the right of each slide, use the code snippet below:

Func<LoadContext, LoadOptions> getLoadOptions = loadContext => new PresentationLoadOptions
{
    CommentsPosition = PresentationCommentsPosition.Right
};
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:

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);
}

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:

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);
}

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.

External resources are not loaded by default. Read the Skip loading of external resources article to learn how to allow trusted resources and decide per resource with a handler in GroupDocs.Conversion for .NET.

Close
Loading

Analyzing your prompt, please hold on...

An error occurred while retrieving the results. Please refresh the page and try again.