Spire.Doc for Java 14.1.3 supports applying custom styles to tables

Spire.Doc for Java 14.1.3 supports applying custom styles to tables

2026-01-16 10:12:52

We're pleased to announce the release of Spire.Doc for Java 14.1.3. This version supports applying custom styles to tables, removing styles via the removeSelf() method, and cloning styles from template documents. Meanwhile, some issues that occurred when converting Word to PDF or Markdown, and updating TOC or page number fields have also been successfully fixed. More details are listed below.

Here is a list of changes made in this release

Category ID Description
New feature SPIREDOC-11582 Added the removeSelf() method to support removing a style.
document.getStyles().get("style1").removeSelf();
New feature SPIREDOC-11583 Supports applying custom styles to tables.
Document doc = new Document();
Section section = doc.addSection();
TableStyle tableStyle = (TableStyle) doc.getStyles().add(StyleType.Table_Style, "TestTableStyle1");
tableStyle.setHorizontalAlignment(RowAlignment.Center);
tableStyle.getBorders().setColor(Color.BLUE);
tableStyle.getBorders().setBorderType(BorderStyle.Single);
Table table = section.addTable();
table.resetCells(1, 1);
table.getRows().get(0).getCells().get(0).addParagraph().appendText("Aligned to the center of the page");
table.setPreferredWidth(PreferredWidth.fromPoints(300));
table.applyStyle(tableStyle);
// table.getFormat().setStyle(tableStyle);
doc.saveToFile(outputDocxFile, FileFormat.Docx);
New feature SPIREDOC-11748 Supports cloning styles from a template document.
doc.copyStylesFromTemplate(inputFile_2);  // Accepts file path as String
doc.copyStylesFromTemplate(doc2);         // Accepts another Document object
Bug SPIREDOC-10278 Fixes the issue where paragraph indentation was incorrect when converting Word to PDF.
Bug SPIREDOC-11142 Fixes the issue where image layout inside tables was rendered incorrectly during Word-to-PDF conversion.
Bug SPIREDOC-11688 Fixes the issue where Word-to-PDF conversion did not correctly apply formatting rules specific to WPS Office.
Bug SPIREDOC-11714 Fixes a NullPointerException that occurred when converting Word to Markdown.
Bug SPIREDOC-11718 Fixes a NullPointerException that occurred during Word-to-PDF conversion.
Bug SPIREDOC-11734 Fixes the issue where the application would hang when updating TOC (Table of Contents) fields.
Bug SPIREDOC-11735 Fixes the issue where page number fields failed to update correctly.
Bug SPIREDOC-11757 Fixes an IllegalStateException ("Unexpected ST_TrueFalse value") during Word-to-PDF conversion.
Click the link below to download Spire.Doc for Java 14.1.3: