Spire.Office for Java 9.2.0 is released

2024-03-01 03:11:48

We are delighted to announce the release of Spire.Office for Java 9.2.0. In this version, Spire.XLS for Java supports saving Kingdraw drawn OLE objects as images. Spire.Barcode for Java supports adding images in the middle of QR codes. In addition, many known issues are fixed in this version. More details are listed below.

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

Here is a list of changes made in this release

Spire.XLS for Java

Category ID Description
New feature SPIREXLS-5046 Supports saving Kingdraw drawn OLE objects as images.
	com.spire.xls.Workbook workbook = new com.spire.xls.Workbook();
	workbook.loadFromFile("data.xlsx");
	Worksheet sheet = workbook.getWorksheets().get(0);
	Object o =  sheet.getCellRange("C2").getFormulaValue();
	if (sheet.hasOleObjects()) {
		for (int i = 0; i < sheet.getOleObjects().size(); i++) {
			IOleObject oleObject = sheet.getOleObjects().get(i);
			OleObjectType oleObjectType = sheet.getOleObjects().get(i).getObjectType();
			byte[] picUrl = null;
			switch (oleObjectType) {
				case Emf:
					picUrl = oleObject.getOleData();;
					break;
			}
			if (picUrl != null) {
				byteArrayToFile(picUrl, "out.png");
				break;
			}
		}
	}
}

public static void byteArrayToFile(byte[] datas, String destPath) {
	File dest = new File(destPath);
	try (InputStream is = new ByteArrayInputStream(datas);
		 OutputStream os = new BufferedOutputStream(new FileOutputStream(dest, false));) {
		byte[] flush = new byte[1024];
		int len = -1;
		while ((len = is.read(flush)) != -1) {
			os.write(flush, 0, len);
		}
		os.flush();
	} catch (IOException e) {
		e.printStackTrace();
	}
}
Bug SPIREXLS-5072
SPIREXLS-5099
Fixes the issue that the content was incorrect when converting Excel to PDF.
Bug SPIREXLS-5076 Fixes the issue that the images were incorrect after copying content.
Bug SPIREXLS-5088 Fixes the issue that the program threw "A workbook must contain at least a visible worksheet" when converting XML to Excel.
Bug SPIREXLS-5089 Optimizes the setting of Locale in the setValue method.
Bug SPIREXLS-5095 Fixes the issue that the program threw "NullPointerException" when copying tables.
Bug SPIREXLS-5098 Fixes the issue that the text content styles changed when converting Excel to HTML.

Spire.Doc for Java

Category ID Description
Bug SPIREDOC-9689 Fixes the issue that extra red vertical lines appeared after converting a Word document to a PDF document.
Bug SPIREDOC-9911 Fixes the issue that text loss occurred after converting an RTF document to a PDF document.
Bug SPIREDOC-10009 Fixes the issue that the program threw java.lang.NullPointerException when converting the same Word document to PDF document more than once under multi-threading.
Bug SPIREDOC-10018 Fixes the issue that the content was incorrect after converting a Word document to a PDF document.
Bug SPIREDOC-10031 Fixes the issue that the size of the PDF file was inconsistent when converting the same Word document to PDF document multiple times under multi-threading.
Bug SPIREDOC-10130 Fixes the issue that the numbers in the header were displayed incorrectly after converting a Word document to a PDF document.
Bug SPIREDOC-10216 Fixes the issue that the content of the updated table of contents was incorrect.
Bug SPIREDOC-10236 Fixes the issue that the program threw java.lang.NullPointerException when converting Word documents to PDF documents.
Bug SPIREDOC-10238 Fixes the issue that the text was garbled after converting a Doc document to a Docx document.
Bug SPIREDOC-10258 Fixes the issue that the program threw multiple exceptions when loading multiple files in a folder under multi-threading.
Bug SPIREDOC-10274 Fixes the issue that extra slashes appeared after converting a Word document to a PDF document.
Bug SPIREDOC-10276 Fixes the issue that the content of the header was displayed repeatedly after unlinking the header to the previous section.

Spire.PDF for Java

Category ID Description
Bug SPIREPDF-6523 Fixes the issue that the program threw java.lang.NullPointerException exception when creating a template for the first page.
Bug SPIREPDF-6527 Fixes the issue that compression of PDF documents did not work.
Bug SPIREPDF-6534 Fixes the issue that the program threw java.lang.NullPointerException when comparing documents.
Bug SPIREPDF-6535 Fixes the issue that the content was garbled after adding a digital signature.
Bug SPIREPDF-6542 Fixes the issue that the MIME type of the added attachment was incorrect.
Bug SPIREPDF-6543 Fixes the issue that the result of verifying the signature was incorrect.

Spire.Presentation for Java

Category ID Description
Bug SPIREPPT-2440 Fixes the issue that the program threw "NullPointerException" error when loading a PPT document.

Spire.Barcode for Java

Category ID Description
New feature - The method for applying a license has been changed to com.spire.barcode.license.LicenseProvider.setLicenseKey(key).
New feature SPIREBARCODE-244 Supports adding pictures to the center of QR code.
BarcodeSettings barCodeSetting = new BarcodeSettings();
BufferedImage image = ImageIO.read(new File("Image/1.png"));
barCodeSetting.setQRCodeLogoImage(image);
Bug SPIREBARCODE-243 Fixes the issue that barcode recognition failed in vertical orientation.