Spire.Office for Java 11.7.0 is released

2026-07-31 09:59:37

We are happy to announce the release of Spire.Office for Java 11.7.0. In this version, Spire.Doc for Java supports SVG image detection with isSVG property; Spire.XLS for Java supports converting a specified cell range to HTML; Spire. Presentation for Java supports converting PowerPoint to pure HTML format; Spire.PDF for Java improves stability and fixes multiple issues. Besides, many issues have been successfully fixed in this version. More details are listed below.

Click the link to download Spire.Office for Java 11.7.0:

Here is a list of changes made in this release

Spire.Doc for Java

Category ID Description
New Feature SPIREDOC-8865 SPIREDOC-11824 SPIREDOC-10144 Added setIgnoreFields and setIgnoreCaseChanges configuration options to the CompareOptions class. Renamed setIgnoreTable(boolean value) to setIgnoreTables(boolean value). Renamed the corresponding getter getIgnoreTable() to getIgnoreTables().
Document doc1 = ConvertUtil.GetNewEngineDocument();
doc1.loadFromFile(inputFile_1);
String[] name1 = new String[]{"DJG_Black_Book", "DJG_Repairs_Expense", "DJG_Sale_Amount", "DJG_Dealer_Payment", "DJG_Auction_Fees"};
String[] value1 = new String[]{"20,000.00", "2,000.00", "13,500.00", "1,000.00", "500.00"};
doc1.getMailMerge().execute(name1, value1);
doc1.isUpdateFields(true);

Document doc2 = ConvertUtil.GetNewEngineDocument();
doc2.loadFromFile(inputFile_2);
String[] name2 = new String[]{"DJG_Black_Book", "DJG_Repairs_Expense", "DJG_Sale_Amount", "DJG_Dealer_Payment", "DJG_Auction_Fees"};
String[] value2 = new String[]{"50,000.00", "5,000.00", "3,500.00", "1,000.00", "200.00"};
doc2.getMailMerge().execute(name2, value2);
doc2.isUpdateFields(true);

CompareOptions options = new CompareOptions();
//set 'Moves'
options.setCompareMoves(true);
//set 'Case Changes'
options.setIgnoreCaseChanges(true);
//set 'Comments'
options.setIgnoreComments(true);
//set 'Fields'
options.setIgnoreFields(true);
//set 'Footnotes'
options.setIgnoreFootnotes(true);
//set 'Tables'
options.setIgnoreTables(true);
//set 'Textboxes'
options.setIgnoreTextboxes(true);
doc1.compare(doc2, "user", new Date(), options);
doc1.saveToFile(outputFile, FileFormat.Docx_2013);
doc1.close();
doc2.close();
New Feature SPIREDOC-11975 Added support for the "Two Lines in One" feature.
Document doc = ConvertUtil.GetNewEngineDocument();
Section section = doc.addSection();
section.setTextDirection(TextDirection.Right_To_Left);
Paragraph titlePara = section.addParagraph();
titlePara.appendText("===== FarEastLayout Two-Lines-in-One Full Scenario Test =====\n\n");

titlePara.appendText("\n\n1. Basic Two-Lines-in-One: ");
// Basic Two-Lines-in-One Combine=true, no brackets, no vertical layout
Paragraph p1 = section.addParagraph();
TextRange farEastLayout = p1.appendText("Basic Two-Lines-in-One: One Two Three Four");
farEastLayout.getCharacterFormat().setFontSize(12);
farEastLayout.getCharacterFormat().setFontNameFarEast("Songti");
FarEastLayout layout1 = new FarEastLayout();
layout1.setCombine(true); // Two-Lines-in-One
farEastLayout.getCharacterFormat().setFarEastLayout(layout1);

// Two-Lines-in-One + various bracket styles
Paragraph p1Title = section.addParagraph();
p1Title.appendText("\n\n2. Two-Lines-in-One + Different Brackets: ");

for (CombineBrackets bracket : CombineBrackets.values()) {
    Paragraph pTmp = section.addParagraph();
    TextRange rt = pTmp.appendText("Bracket Type " + bracket.name() + ": A B C D");
    rt.getCharacterFormat().setFontSize(12);
    rt.getCharacterFormat().setFontNameFarEast("Songti");
    FarEastLayout layoutTmp = new FarEastLayout();
    layoutTmp.setCombine(true);
    layoutTmp.setCombineBrackets(bracket);
    rt.getCharacterFormat().setFarEastLayout(layoutTmp);
}

doc.saveToFile(outputFile, FileFormat.Docx);
doc.close();
New Feature SPIREDOC-12004 Added isSVG property support to check if a picture is an SVG.
DocPicture picture = (DocPicture) object;if (picture.isSVG()) {
    byte[] svgBytes = picture.getImageBytes();
    Files.write(Paths.get(outputFile), svgBytes);
}
Bug Fix SPIREDOC-11155 Fixed the issue where a StringIndexOutOfBoundsException occurred when comparing documents.
Bug Fix SPIREDOC-11816 Fixed the issue where table formatting became disordered after accepting revisions.
Bug Fix SPIREDOC-11918 SPIREDOC-11926 SPIREDOC-11960 SPIREDOC-11964 SPIREDOC-11968 Fixed the issue where content layout was inconsistent when converting Word to PDF.
Bug Fix SPIREDOC-11919 Fixed the issue where the display effect was incorrect when opening merged Word documents in WPS.
Bug Fix SPIREDOC-11956 Fixed the issue where table layout was incorrect when converting Word to HTML.
Bug Fix SPIREDOC-11962 Fixed the issue where images rendered incorrectly when converting Word to PDF in Ubuntu environments.
Bug Fix SPIREDOC-11966 Fixed the issue where font effects were incorrect when converting Word to PDF.
Bug Fix SPIREDOC-11973 Fixed the issue where packaging errors occurred in higher-version Java environments.
Bug Fix SPIREDOC-11975 Added compatibility for "Double-line Combination" effect when converting Word to PDF.
Bug Fix SPIREDOC-11857 Fixed the issue where saving a Word document took too long.
Bug Fix SPIREDOC-11893 Fixed the issue where a NullPointerException was thrown when comparing Word documents.
Bug Fix SPIREDOC-11958 Fixed the issue where content overlapped when converting Word to PDF.
Bug Fix SPIREDOC-11961 Fixed the issue where image text appeared garbled when converting Word to PDF.
Bug Fix SPIREDOC-11979 Fixed the issue where the layout was incorrect when converting Word to PDF.
Bug Fix SPIREDOC-11981 Fixed the issue where an ArgumentOutOfRangeException was thrown when converting Word to PDF.
Bug Fix SPIREDOC-11983 Fixed the issue where styles were not fully copied from a template to another document.
Bug Fix SPIREDOC-11989 Fixed the issue where a "Document element did not appear. Line 1, position 1" exception was thrown when loading a Word document.
Bug Fix SPIREDOC-11993 Fixed the issue where extra blank pages were added when cloning a document.
Bug Fix SPIREDOC-11994 Fixed the issue where a "String index out of range: 76" exception was thrown when comparing Word documents.
Bug Fix SPIREDOC-11996 Fixed the issue where the table format was incorrect when cloning sections.
Bug Fix SPIREDOC-12005 Fixed the issue where the rendering effect was incorrect when converting Word to PDF.

Spire.XLS for Java

Category ID Description
New Feature SPIREXLS-5934 Adds a new property to control whether to retain frozen rows and columns when converting Excel to HTML, with the default value set to false.
Workbook wb = new Workbook();
wb.loadFromFile(inputFile);
HTMLOptions.Default.isSaveFreezedPanes(true);
wb.saveToFile(outputFile, FileFormat.HTML);
wb.dispose();
New Feature SPIREXLS-5938 Adds the isSavePicInRelativePath property to control whether images are saved using relative paths when converting Excel to Markdown.
Workbook wb = new Workbook();
        wb.loadFromFile(inputFile);
        MarkdownOptions markdownOptions = new MarkdownOptions();
        markdownOptions.isSavePicInRelativePath(true);
        wb.saveToMarkdown(outputFile, markdownOptions);
        wb.dispose();
New Feature SPIREXLS-5948 Adds support for the BYROW and BYCOL functions.
                                sheet.getRange().get("G7").setFormula("=BYROW(B7:F7, LAMBDA(row, AVERAGE(row)))");

                                sheet.getRange().get("B8").setFormula("=BYCOL(B2:B7, LAMBDA(col, AVERAGE(col)))");
New Feature SPIREXLS-5975 Adds the isSaveHyperlinkAsRef property to control whether to save hyperlinks as Markdown reference-style links when converting Excel to Markdown.
Workbook wb = new Workbook();
wb.loadFromFile(inputFile);
MarkdownOptions markdownOptions = new MarkdownOptions();
markdownOptions.isSaveHyperlinkAsRef(true);
wb.saveToMarkdown(outputFile, markdownOptions);
wb.dispose();
New Feature SPIREXLS-5980 Supports converting a specified cell range to HTML.
StringBuilder sb = new StringBuilder();
Workbook workbook = new Workbook();
workbook.loadFromFile(inputFile);

Worksheet sheet = workbook.getWorksheets().get(0);
CellRange cell = sheet.getRange().get("A1:B3");
sb.append(cell.getHtmlString());
New Feature SPIREXLS-5982 Adds support for the XMATCH function.
sheet.getRange().get("C4").setFormula("=XMATCH(\"Lucy\", A2:A5)");
New Feature SPIREXLS-5983 Adds support for swapping rows and columns.
Workbook workbook = new Workbook();
workbook.loadFromFile(inputFile);
Worksheet sheet = workbook.getWorksheets().get(0);

EnumSet<CopyRangeOptions> options = EnumSet.of(CopyRangeOptions.Transpose, CopyRangeOptions.All);
sheet.getRange().get("D1").setText("Transpose A1:C4 to D2:G3:");
sheet.getRange().get("A1:C4").copy(sheet.getRange().get("D2:G3"), options);
sheet.getRange().get("D4").setText("Transpose A1:B5 to D5:");
sheet.getRange().get("A1:B5").copy(sheet.getRange().get("D5"), options);

options = EnumSet.of(CopyRangeOptions.Transpose, CopyRangeOptions.CopyStyles);
sheet.getRange().get("D9").setText("Transpose A10 to D10:");
sheet.getRange().get("A10").copy(sheet.getRange().get("D10"), options);
sheet.getRange().get("D11").setText("Transpose A11:B11 to D12:");
sheet.getRange().get("A11:B11").copy(sheet.getRange().get("D12"), options);

options = EnumSet.of(CopyRangeOptions.Transpose, CopyRangeOptions.CopyConditionalFormats);
sheet.getRange().get("D16").setText("Transpose B17:B20 to D17:");
sheet.getRange().get("B17:B20").copy(sheet.getRange().get("D17"), options);

options = EnumSet.of(CopyRangeOptions.Transpose, CopyRangeOptions.CopyStyles);
sheet.getRange().get("D19").setText("Transpose B17:B20 to D20:");
sheet.getRange().get("B17:B20").copy(sheet.getRange().get("D20"), options);

options = EnumSet.of(CopyRangeOptions.Transpose);
sheet.getRange().get("D22").setText("Transpose B17:B20 to D23:");
sheet.getRange().get("B17:B20").copy(sheet.getRange().get("D23"), options);

workbook.saveToFile(outputFile);

sheet.dispose();
workbook.dispose();
New Feature SPIREXLS-5990 Adds support for embedding checkbox controls in cells and setting their checked states.
Workbook workbook = new Workbook();
Worksheet sheet = workbook.getWorksheets().get(0);

XlsRange range = (XlsRange)sheet.getRange().get("A1");
range.insertEmbedCheckBox();
range.setEmbedCheckBoxCheckState(true);

workbook.saveToFile(outputFile);
workbook.dispose();
New Feature SPIREXLS-6020 Adds support for the Data Table (What-If Analysis) feature, covering creation, editing, deletion, summary generation, and consolidation.
Workbook wb = new Workbook();
wb.loadFromFile(inputFile);
Worksheet worksheet = wb.getWorksheets().get(0);
// Access the collection of scenarios in the worksheet
XlsScenarioCollection scenarios = worksheet.getScenarios();
//Initialize list objects with different values for scenarios
List currentChangePercentage_Values = new ArrayList() {{ add(0.23); add(0.8); add(1.1); add(0.5); add(0.35); add(0.2); }};
List increasedChangePercentage_Values = new ArrayList() {{ add(0.45); add(0.56); add(0.9); add(0.5); add(0.58); add(0.43); }};
List decreasedChangePercentage_Values = new ArrayList() {{ add(0.3); add(0.2); add(0.5); add(0.3); add(0.5); add(0.23); }};
List currentQuantity_Values = new ArrayList() {{ add(1500); add(3000); add(5000); add(4000); add(500); add(4000); }};
List increasedQuantity_Values = new ArrayList() {{ add(1000); add(5000); add(4500); add(3900); add(10000); add(8900); }};
List decreasedQuantity_Values = new ArrayList() {{ add(1000); add(2000); add(3000); add(3000); add(300); add(4000); }};
//Add scenarios in the worksheet with different values for the same cells
scenarios.add("Current % of Change", worksheet.getRange().get("F5:F10"), currentChangePercentage_Values);
scenarios.add("Increased % of Change", worksheet.getRange().get("F5:F10"), increasedChangePercentage_Values);
scenarios.add("Decreased % of Change", worksheet.getRange().get("F5:F10"), decreasedChangePercentage_Values);
scenarios.add("Current Quantity", worksheet.getRange().get("D5:D10"), currentQuantity_Values);
scenarios.add("Increased Quantity", worksheet.getRange().get("D5:D10"), increasedQuantity_Values);
scenarios.add("Decreased Quantity", worksheet.getRange().get("D5:D10"), decreasedQuantity_Values);
//Saving the workbook
wb.saveToFile(outputFile, ExcelVersion.Version2013);
wb.dispose();
Workbook wb = new Workbook();
wb.loadFromFile(inputFile);
Worksheet worksheet = wb.getWorksheets().get(0);
// Access the collection of scenarios in the worksheet
XlsScenarioCollection scenarios = worksheet.getScenarios();
XlsScenario scenario1 = scenarios.get(0);
XlsScenario scenario2 = scenarios.get(1);
//Modify the scenario
scenario1.setVariableCells(worksheet.getRange().get("A1:A5"), scenario2.getValues());
CellRange sourceCell = worksheet.getRange().get("B1:B5");
scenario2.setVariableCells(sourceCell, scenario2.getValues());
scenario1.show();
scenario2.show();
//Saving the workbook
wb.saveToFile(outputFile, ExcelVersion.Version2013);
wb.dispose();
Workbook wb = new Workbook();
wb.loadFromFile(inputFile);
Worksheet worksheet = wb.getWorksheets().get(0);
// Access the collection of scenarios in the worksheet
XlsScenarioCollection scenarios = worksheet.getScenarios();
//delete the scenario
scenarios.removeScenarioAt(0);// Delete by index
scenarios.removeScenarioByName("two");// Delete by name
String content = "";
content += "Count:" + scenarios.getCount() + "\n";
content += "ContainsScenario:" + scenarios.containsScenario("two") + "\n";
content += "ContainsScenario:" + scenarios.containsScenario("one") + "\n";
TestUtil.writeAllText(outputFile, content);
//Saving the workbook
wb.dispose();
Workbook wb = new Workbook();
wb.loadFromFile(inputFile);
Worksheet worksheet = wb.getWorksheets().get(0);
// Access the collection of scenarios in the worksheet
XlsScenarioCollection scenarios = worksheet.getScenarios();
//Initialize list objects with different values for scenarios
List currentChangePercentage_Values = new ArrayList() {{ add(0.23); add(0.8); add(1.1); add(0.5); add(0.35); add(0.2); }};
List increasedChangePercentage_Values = new ArrayList() {{ add(0.45); add(0.56); add(0.9); add(0.5); add(0.58); add(0.43); }};
List decreasedChangePercentage_Values = new ArrayList() {{ add(0.3); add(0.2); add(0.5); add(0.3); add(0.5); add(0.23); }};
List currentQuantity_Values = new ArrayList() {{ add(1500); add(3000); add(5000); add(4000); add(500); add(4000); }};
List increasedQuantity_Values = new ArrayList() {{ add(1000); add(5000); add(4500); add(3900); add(10000); add(8900); }};
List decreasedQuantity_Values = new ArrayList() {{ add(1000); add(2000); add(3000); add(3000); add(300); add(4000); }};
//Add scenarios in the worksheet with different values for the same cells
scenarios.add("Current % of Change", worksheet.getRange().get("F5:F10"), currentChangePercentage_Values);
scenarios.add("Increased % of Change", worksheet.getRange().get("F5:F10"), increasedChangePercentage_Values);
scenarios.add("Decreased % of Change", worksheet.getRange().get("F5:F10"), decreasedChangePercentage_Values);
scenarios.add("Current Quantity", worksheet.getRange().get("D5:D10"), currentQuantity_Values);
scenarios.add("Increased Quantity", worksheet.getRange().get("D5:D10"), increasedQuantity_Values);
scenarios.add("Decreased Quantity", worksheet.getRange().get("D5:D10"), decreasedQuantity_Values);
//Create Summary
worksheet.getScenarios().summary(worksheet.getRange().get("L7"));
//Saving the workbook
wb.saveToFile(outputFile, ExcelVersion.Version2013);
wb.dispose();
Workbook wb = new Workbook();
wb.loadFromFile(inputFile);
Worksheet worksheet1 = wb.getWorksheets().get(0);
Worksheet worksheet2 = wb.getWorksheets().get(1);// This sheet contains Scenarios
//Merge the scenario
worksheet1.getScenarios().merge(worksheet2);
//Saving the workbook
wb.saveToFile(outputFile, ExcelVersion.Version2013);
wb.dispose();
New Feature SPIREXLS-6162 Adds support for converting Excel to JSON data.
Workbook workbook = new Workbook();
        workbook.loadFromFile(inputFile);
        workbook.saveToFile(outputFile, FileFormat.Json);
        workbook.dispose();
Bug Fix SPIREXLS-6160 Fixes the issue where an "Invalid cell name" exception was thrown when loading an Excel document.
Bug Fix SPIREXLS-6163 Fixes the issue where extra vertical lines appeared on chart axes when copying a cell range.
Bug Fix SPIREXLS-6166 Fixes the issue where retrieving the print area of an Excel document failed.
Bug Fix SPIREXLS-5940 Fixes the issue where a "System.ArgumentOutOfRangeException" exception was thrown when copying a worksheet containing a Slicer.

Spire.Presentation for Java

Category ID Description
New Feature - Added support for converting PowerPoint to pure HTML format (Note: Some unsupported elements are rendered as SVG).
Presentation ppt = new Presentation();
ppt.loadFromFile(inputFile);
ppt.getSaveToHtmlOption().setPureHtml(true);
ppt.saveToFile(outputFile, FileFormat.HTML);
ppt.dispose();
Bug Fix SPIREPPT-2939 Fixed an issue where images turned white when converting PowerPoint to PDF.
Bug Fix SPIREPPT-3157 Fixed an issue where text line wrapping was incorrect when converting PowerPoint to PDF.

Spire.PDF for Java

Category ID Description
Bug Fix SPIREPDF-5182 Fixed an issue where signature verification failed after adding a digital signature.
Bug Fix SPIREPDF-7065 Fixed an issue with the signature error “Undefined length encoding”.
Bug Fix SPIREPDF-7547 Optimized memory consumption when replacing document content.
Bug Fix SPIREPDF-8095 Fixed an issue where project packaging failed under Java 21.
Bug Fix SPIREPDF-8096 Fixed a “NullPointerException” when compressing PDF files.
Bug Fix SPIREPDF-8099 Fixed an “ArrayIndexOutOfBoundsException” when converting PDF to images.