GroupDocs.Conversion provides the PdfConvertOptions class, which enables fine-grained control over the conversion process when converting documents to PDF format. In addition to common conversion options, the PdfConvertOptions class offers several advanced features, including:
Specifies page rotation. Supported options are None, On90, On180, and On270.
The following code demonstrates how to convert a document to PDF with advanced options:
importcom.groupdocs.conversion.Converter;importcom.groupdocs.conversion.examples.Constants;importcom.groupdocs.conversion.options.convert.PdfConvertOptions;importcom.groupdocs.conversion.options.convert.Rotation;publicclassConvertToPdfWithAdvancedOptions{publicstaticvoidconvert(){// Initialize the converter with the source document
try(Converterconverter=newConverter("annual-review.docx")){// Configure advanced PDF conversion options
PdfConvertOptionsoptions=newPdfConvertOptions();options.setPageNumber(2);options.setPagesCount(1);options.setRotate(Rotation.On180);options.setDpi(300);options.setPageWidth(1024);options.setPageHeight(768);// Perform the conversion
converter.convert("converted_with_options.pdf",options);}}publicstaticvoidmain(String[]args){convert();}}
annual-review.docx is sample file used in this example. Click here to download it.
converted_with_options.png is converted PDF document. Click here to download it.
PDF-Specific Options:
The PdfOptions class provides additional settings for customizing PDF output, allowing conversion to different PDF versions and optimizing PDF formatting:
Specifies how to display the document on exiting full-screen mode. Available options are: UseNone, UseOutlines, UseThumbs, FullScreen, UseOC, UseAttachments.
Configures how the document is displayed when opened.
By leveraging these advanced options, developers can precisely tailor the PDF conversion process to meet specific requirements, ensuring optimized and secure document output.
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.