Convert to Presentation with advanced options

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.

converted_with_options.ppt is converted PPT document. 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.