GroupDocs.Conversion provides the SpreadsheetLoadOptions class to give you better control over how the source spreadsheet document will be processed. The following options could be set:
setFormat allows you to specify explicitly the type of the source spreadsheet document. Available options are: Xls, Xlsx, Xlsm, Xlsb, Ods, Ots, Xltx, Xlt, Xltm, Tsv, Xlam, Csv.
setDefaultFont sets a default font. The following font will be used if a spreadsheet font is missing.
setFontSubstitutes sets substitute specific fonts from the source spreadsheet document.
The following code snippet shows how to convert a spreadsheet and specify font substitution for missing fonts:
importcom.groupdocs.conversion.Converter;importcom.groupdocs.conversion.contracts.FontSubstitute;importcom.groupdocs.conversion.options.convert.PdfConvertOptions;importcom.groupdocs.conversion.options.load.SpreadsheetLoadOptions;importjava.util.ArrayList;importjava.util.List;...SpreadsheetLoadOptionsloadOptions=newSpreadsheetLoadOptions();List<FontSubstitute>fontSubstitutes=newArrayList<FontSubstitute>();fontSubstitutes.add(FontSubstitute.create("Tahoma","Arial"));fontSubstitutes.add(FontSubstitute.create("Times New Roman","Arial"));loadOptions.setDefaultFont("Helvetica");loadOptions.setOnePagePerSheet(true);loadOptions.setFontSubstitutes(fontSubstitutes);Converterconverter=newConverter("sample.xlsx",loadOptions);PdfConvertOptionsoptions=newPdfConvertOptions();converter.convert("converted.pdf",options);
Specify range
The following code snippet shows how to convert a spreadsheet and specify the exact range of rows and columns to be converted: