Spire.Office for Java 8.10.2 is released

2023-10-30 06:05:03

We are delighted to announce the release of Spire.Office for Java 8.10.2. In this version, Spire.XLS for Java supports verifying whether the password for restricted editing is correct; Spire.PDF for Java supports configuring AES encryption algorithms and setting the names of existing fields; Spire.Doc for Java synchronizes the AppendHorizonalLine() method to Java. Spire.Presentation for Java supports converting specified slides to SVG and PowerPoint presentations to SVGZ. In addition, many known issues are fixed in this version. More details are listed below.

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

Here is a list of changes made in this release

Spire.XLS for Java

Category ID Description
New feature SPIREXLS-4896 Supports verifying whether the password for restricted editing is correct.
worksheet.checkProtectionPassword(String password) 
Bug SPIREXLS-4879 Fixes the issue that the content of the document was incorrect when converting Excel to PDF.
Bug SPIREXLS-4890
SPIREXLS-4908
Fixes the issue that the content in charts was incorrect when converting Excel to images.
Bug SPIREXLS-4893 Fixes the issue that table borders were lost when converting Excel to OFD.
Bug SPIREXLS-4900 Fixes the issue that the program threw "Invalid ValidationAlertType string val" when loading an Excel file.
Bug SPIREXLS-4901 Fixes the issue that pivot table calculated fields couldn’t be added as column fields.
Bug SPIREXLS-4902 Fixes the issue that the names of pivot table calculated fields were automatically prefixed with "Sum of".
Bug SPIREXLS-4910 Fixes the issue that the program threw "java.lang.ClassException" when loading an Excel file.

Spire.PDF for Java

Category ID Description
New feature - Synchronizes the new encryption and decryption interface to Java, and supports configuring the AES encryption algorithm.
PdfEncryptionAlgorithm.AES
//Create password security policies
PdfSecurityPolicy securityPolicy = new PdfPasswordSecurityPolicy("", "123456"); 
//Set AES encryption algorithm
securityPolicy.setEncryptionAlgorithm( PdfEncryptionAlgorithm.AES_256); 
//Set document permissions (ownership), default is ForbidAll.
securityPolicy.setDocumentPrivilege(PdfDocumentPrivilege.getForbidAll());
securityPolicy.getDocumentPrivilege().setAllowDegradedPrinting(true);
securityPolicy.getDocumentPrivilege().setAllowModifyAnnotations(true);
securityPolicy.getDocumentPrivilege().setAllowAssembly(true);
securityPolicy.getDocumentPrivilege().setAllowModifyContents(true);
securityPolicy.getDocumentPrivilege().setAllowFillFormFields(true);
securityPolicy.getDocumentPrivilege().setAllowPrint(true);
pdf.encrypt(securityPolicy);
PdfDocument pdf = new PdfDocument();
//Pass the open password to open the PDF document
pdf.loadFromFile(inputFile, "1234"); 
//Decrypt
pdf.decrypt();
pdf.saveToFile(outputFile, FileFormat.PDF);
pdf.dispose();
New feature SPIREPDF-6306 Supports setting the names of existing fields.
PdfDocument document=new PdfDocument();
document.loadFromFile("input.pdf");
PdfFormWidget formWidget = (PdfFormWidget)document.getForm();
for (int i = 0; i < formWidget.getFieldsWidget().getCount(); i++)
{
    PdfField field = (PdfField)formWidget.getFieldsWidget().get(i);
    for (PdfFieldWidget widget : (Iterable<? extends PdfFieldWidget>) formWidget.getFieldsWidget())
    {
        if (widget.getName() == "oldName")
        {
            widget.setName("NewName");
        }
    }
}
document.saveToFile("result.pdf",FileFormat.PDF);
Bug SPIREPDF-6253
SPIREPDF-6313
Fixes the issue that the background was incorrect after converting PDF to SVG.
Bug SPIREPDF-6275 Fixes the issue that the shape color was incorrect and the content was missing after converting PDF to PPTX.
Bug SPIREPDF-6277 Fixes the issue that images were obstructed after converting PDF to PPTX.
Bug SPIREPDF-6300 Fixes the issue that the standard validation failed after converting PDF to PDFA2B.
Bug SPIREPDF-6307 Fixes the issue that stamps were lost after converting OFD to PDF.
Bug SPIREPDF-6324 Fixes the issue that the program threw "NullPointerException" when loading PDF.

Spire.Doc for Java

Category ID Description
New feature SPIREDOC-9912 Synchronizes the AppendHorizonalLine() method to Java.
paragraph.appendHorizonalLine()
New feature - Supports switching fonts that do not support drawing characters through the FontFallbackRule method in XML when converting to a non-flow layout document.
Document doc = new Document();
doc.loadFromFile(inputFile);
doc.saveFontFallbackRuleSettings(outputFile_xml);
doc.loadFontFallbackRuleSettings(outputFile_xml);
doc.saveToFile(outputFile, FileFormat.PDF);
Instructions:
If there is no XML available, first save an XML using saveFontFallbackRuleSettings and then manually edit the font replacement rules in the XML.
The rules consist of three attributes: Ranges correspond to Unicode ranges for each character; FallbackFonts correspond to the font names for substitution; BaseFonts correspond to the font names for characters in the document.
When editing the XML, it is important to note that the rules are searched from top to bottom for character matching.
After editing the XML, load the rules using the loadFontFallbackRuleSettings method.
Bug SPIREDOC-9711 Fixes the issue that the program threw "OutOfMemoryError" when using WPS rules to convert Word to PDF.
Bug SPIREDOC-9781 Fixes the issue that the embedding of "楷体_GB2312" font failed.
Bug SPIREDOC-9842 Fixes the issue that the Chinese characters garbled after converting RTF to PDF.
Bug SPIREDOC-9854 Fixes the issue that the editable area was changed after saving the Word document.
Bug SPIREDOC-9860 Fixes the issue that the editable area was changed after modifying Word documents.
Bug SPIREDOC-9862 Fixes the issue that the result of setting image zoom size was incorrect.
Bug SPIREDOC-9871 Fixes the issue that the table style was incorrect after converting Word to HTML.
Bug SPIREDOC-9880 Fixes the issue that the font size was incorrect after converting HTML to Word.
Bug SPIREDOC-9891 Fixes the issue that each value would be displayed twice after doing mail merging using executeWidthNestedRegion() method.
Bug SPIREDOC-9892 Fixes the issue that the file became much larger after converting Word to OFD.

Spire.Presentation for Java

Category ID Description
New feature SPIREPPT-2328 Supports converting PowerPoint documents to SVGZ documents.
Presentation ppt = new Presentation();
ppt.loadFromFile("input.pptx");
List bytes = ppt.saveToSVGZ();
for (int i = 0; i < bytes.size(); i++) {
FileOutputStream fileOutputStream = new FileOutputStream("slide" + i + ".svgz");
fileOutputStream.write(bytes.get(i));
fileOutputStream.flush();
fileOutputStream.close();
}
New feature SPIREPPT-2372 Supports converting specified slides to SVG documents.
Presentation ppt = new Presentation();
ppt.loadFromFile("input.pptx");
List bytes = ppt.saveToSVG(0, 36);
for (int i = 0; i < bytes.size(); i++) {
FileOutputStream fileOutputStream = new FileOutputStream("slide" + (i + 1) + ".svg");
fileOutputStream.write(bytes.get(i));
fileOutputStream.flush();
fileOutputStream.close();
}
Bug SPIREPPT-2343 Fixes the issue that the display of the content was incomplete after converting PowerPoint to PDF.
Bug SPIREPPT-2369 Fixes the issue that the hand-drawn pictures were lost after converting PowerPoint to PDF.
Bug SPIREPPT-2377 Fixes the issue that the program threw an exception java.lang.NullPointerException when loading PowerPoint documents.