Convert to WordProcessing with advanced options

GroupDocs.Conversion offers the WordProcessingConvertOptions class, enabling fine-tuned control over the conversion process when working with word-processing formats. This class extends the base conversion options with additional advanced parameters, allowing developers to achieve highly customized results.

OptionDescription
setFormat()Defines the desired output document type. Supported formats include Doc, Docm, Docx, Dot, Dotx, Rtf, Odt, Ott, Mobi, and Txt.
setPageWidth()Sets the target page width after conversion (measured in points).
setPageHeight()Specifies the desired page height after conversion (measured in points).
setDpi()Adjusts the target page DPI (dots per inch) to control the quality and resolution of the output.
setPassword()Enables password protection for the converted file, requiring a specified password for access.
setRtfOptions()Configures RTF-specific settings through the RtfOptions class. Includes: setExportImagesForOldReaders - controls whether additional keywords for compatibility with older RTF readers are included, potentially affecting document size.
setZoom()Specifies the zoom level for the output document, defined as a percentage.

The following example demonstrates how to convert a PDF document to an ODT file using advanced conversion options:

import com.groupdocs.conversion.Converter;
import com.groupdocs.conversion.filetypes.WordProcessingFileType;
import com.groupdocs.conversion.options.convert.WordProcessingConvertOptions;

public class ConvertToWordProcessingWithAdvancedOptions {
    public static void convert() {
        // Load the source document
        try(Converter converter = new Converter("professional-services.pdf")) {
            // Configure presentation conversion options
            WordProcessingConvertOptions options = new WordProcessingConvertOptions();
            options.setPageNumber(2);
            options.setPagesCount(1);
            options.setFormat(WordProcessingFileType.Doc);

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

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

professional-services.pdf is sample file used in this example. Click here to download it.

converted_with_options.doc is converted Doc document. Click here to download it.

This level of configurability makes the WordProcessingConvertOptions class a powerful tool for developers seeking to optimize document conversion workflows.