Convert to Presentation with advanced options

View as MarkdownMarkdown

Set up your AI agent

Give your coding agent live access to the GroupDocs documentation and API reference through the GroupDocs Docs MCP server — no install, no API key. Learn more

claude mcp add --transport http groupdocs-docs https://docs.groupdocs.com/mcp

Also process documents locally

The GroupDocs.Conversion MCP server lets your agent work with files on your machine; they are never uploaded. It needs the .NET 10 SDK or Docker.

claude mcp add groupdocs-conversion -- dnx GroupDocs.Conversion.Mcp --yes
Folders, licensing and more →

GroupDocs.Conversion offers the PresentationConvertOptions class, allowing developers to have precise control over the conversion process when converting documents to presentation formats. In addition to the common conversion options provided by the base class, PresentationConvertOptions introduces a range of advanced settings to enhance flexibility and meet specific requirements.

OptionDescription
setFormat()Defines the output presentation format. Supported formats include:Ppt, Pps, Pptx, Ppsx, Odp, Otp, Potx, Pot, Potm, Pptm, Ppsm.
setPassword()Protects the converted presentation with a specified password to ensure confidentiality.
setZoom()Adjusts the zoom level of the converted presentation as a percentage.

The following example demonstrates how to convert a document to a presentation format (e.g., .ppt) using advanced options:

import com.groupdocs.conversion.Converter;
import com.groupdocs.conversion.filetypes.PresentationFileType;
import com.groupdocs.conversion.options.convert.PresentationConvertOptions;

public class ConvertToPresentationWithAdvancedOptions {
    public static void convert() {
        // Load the source document
        try(Converter converter = new Converter("annual-review.docx")) {
            // Configure presentation conversion options
            PresentationConvertOptions options = new PresentationConvertOptions();
            options.setPageNumber(2);                     // Start conversion from page 2
            options.setPagesCount(1);                     // Convert only 1 page
            options.setFormat(PresentationFileType.Ppt);  // Set output format to PowerPoint (.ppt)

            // Perform the conversion
            converter.convert("converted_with_options.ppt", options);
        }
    }

    public static void main(String[] args){
        convert();
    }
}

annual-review.docx is sample file used in this example. Click here to download it.

By using advanced conversion options, developers can fine-tune the output presentation to ensure compatibility, security, and optimal formatting, making it a powerful tool for both professional and personal use.