Spire.XLS for Java 5.4.3 supports setting a maximum number of pages to convert when converting Excel file to PDF

2022-04-19 09:20:07

We are happy to announce the release of Spire.XLS for Java 5.4.3. This version supports setting a maximum number of pages to convert when converting Excel file to PDF, and enhances the conversion from Excel to PDF, Excel to PDFA, Excel to HTML. In addition, it fixes some known issues such as the output file was failed to open after adding watermark to an Excel file. More details are listed below.

Here is a list of changes made in this release

Category ID Description
New feature - Supports setting a maximum number of pages to convert when converting Excel file to PDF.
workbook.loadFromFile(inputFile);
//Fit to page
workbook.getConverterSetting().setSheetFitToPage(true);
//Set the maximum number of pages to convert
workbook.getConverterSetting().setMaxConvertPages();
//Save to PDF file
workbook.saveToFile(outputFile, FileFormat.PDF);
workbook.dispose(); 
New feature SPIREXLS-3763 Supports using ApplyStyle() to apply the style for a cell range.
//Create a Workbook object
Workbook workbook = new Workbook();
//Load a sample Excel file
workbook.loadFromFile("in.xlsx");
//Get the first worksheet
Worksheet sheet = workbook.getWorksheets().get(0);
//Create a CellStyle object
CellStyle fontStyle = workbook.getStyles().addStyle("headerFontStyle");
//Set the font color, size and style
fontStyle.getFont().setColor(Color.white);
fontStyle.getFont().isBold(true);
fontStyle.getFont().setSize(12);
fontStyle.setHorizontalAlignment(HorizontalAlignType.Center);
CellStyleFlag flag = new CellStyleFlag();
flag.setFontColor(true);
flag.setFontBold(true);
flag.setFontSize(true);
flag.setHorizontalAlignment(true);
//Apply style
sheet.getRange().get(1, 1, 1, 8).applyStyle(fontStyle, flag);
workbook.saveToFile("out.xlsx", ExcelVersion.Version2016);
Bug SPIREXLS-3730 Fixes the issue that the application threw "Illegal characters in path" error when converting Excel file to Html.
Bug SPIREXLS-3731 Fixes the issue that the content was lost after converting Excel file to PDF.
Bug SPIREXLS-3733 Fixes the issue that the application threw " java.lang.IllegalAccessError" when converting Excel file to PDF with openjdk17.
Bug SPIREXLS-3741 Fixes the issue that the application hung a long time when converting Excel file to PDF.
Bug SPIREXLS-3671 Fixes the issue that the formula calculated incorrectly and some Chinese text was garbled after converting Excel file to PDF.
Bug SPIREXLS-3755 Fixes the issue that the output file was failed to open after adding watermark to an Excel file.
Bug SPIREXLS-3761 Fixes the issue that the transparency verification failed after converting Excel file to PDFA and doing a pre-flight checking in Adobe PDF.
Bug SPIREXLS-3766 Fixes the issue that the application threw "NullPointerException" when saving Excel file.
Click the link to download Spire.XLS for Java 5.4.3: