Convert to Spreadsheet with advanced options
Leave feedback
GroupDocs.Conversion provides the SpreadsheetConvertOptions class, allowing fine-grained control over the conversion process when converting documents to spreadsheet formats. This class extends the common conversion options available in the base class and introduces additional configuration parameters for enhanced flexibility:
Sets the zoom level of the resulting document, defined as a percentage.
The code snippet below demonstrates how to configure and execute a document conversion to a spreadsheet format using advanced options. In this example, only a specific page from the input document is converted, and additional parameters such as format and zoom level are defined:
importcom.groupdocs.conversion.Converter;importcom.groupdocs.conversion.filetypes.SpreadsheetFileType;importcom.groupdocs.conversion.options.convert.SpreadsheetConvertOptions;publicclassConvertToSpreadsheetWithAdvancedOptions{publicstaticvoidconvert(){// Load the source document
try(Converterconverter=newConverter("formatting.docx")){// Set conversion options for spreadsheets
SpreadsheetConvertOptionsoptions=newSpreadsheetConvertOptions();options.setPageNumber(2);// Convert only the second page
options.setPagesCount(1);// Limit to a single page
options.setFormat(SpreadsheetFileType.Xls);// Output format
options.setZoom(50);// Set zoom level to 50%
// Perform the conversion
converter.convert("converted_with_options.xls",options);}}publicstaticvoidmain(String[]args){convert();}}
formatting.docx is sample file used in this example. Click here to download it.
converted_with_options.xls is converted XLS document. Click here to download it.
This flexibility enables tailored conversion workflows, ensuring the output meets specific requirements such as format compatibility, content accessibility, or security constraints.
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.