Convert to Spreadsheet with advanced options

GroupDocs.Conversion provides the SpreadsheetConvertOptions class to give you better control over the conversion results when converting to spreadsheet formats. Along with common convert options from the base class, the SpreadsheetConvertOptions has the following additional options:

  • setFormat specifies desired result document type. Available options are: Xls, Xlsx, Xlsm, Xlsb, Ods, Ots, Xltx, Xlt, Xltm, Tsc, Xlam, Csv.
  • setPassword whether the converted document will be password-protected with the specified password.
  • setZoom specifies the zoom level in percentage.

The following code snippet shows how to convert to a spreadsheet with advanced options:

import com.groupdocs.conversion.Converter;
import com.groupdocs.conversion.filetypes.SpreadsheetFileType;
import com.groupdocs.conversion.options.convert.SpreadsheetConvertOptions;
import com.groupdocs.conversion.options.load.WordProcessingLoadOptions;
...
Converter converter = new Converter("sample.docx");
SpreadsheetConvertOptions options = new SpreadsheetConvertOptions();
options.setPageNumber(2);
options.setPagesCount(1);
options.setFormat(SpreadsheetFileType.Xls);
options.setZoom(150);

converter.convert("converted.xls", options);