Spire.Office for Java 3.12.1

Spire.Office for Java 3.12.1 is released

We are happy to announce the released of Spire.Office for Java 3.12.1. In this version, Spire.PDF for Java supports converting PDF to TIFF, improves the method logic of doc.getPages().get(0).isBlank() and implements the function with regard to extracting PDF texts as well as reading/writing XMP meta data. Moreover, it also enhances the conversions from PDF to Image/Excel/Word. More details are given below.

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

Here is a list of changes made in this release

Spire.PDF for Java

Category ID Description
New Feature SPIREPDF-2627 Supports converting PDF to TIFF.
PdfDocument pdf=new PdfDocument();
pdf.loadFromFile("C:/Test.pdf");
pdf.saveToTiff("C:/1.tiff");
pdf.saveToTiff("C:/2.tiff",1,2,TiffCompressionTypes.DEFAULT);
New Feature SPIREPDF-3819
SPIREPDF-3820
Improves method logic of doc.getPages().get(0).isBlank().
New Feature SPIREPDF-3819
SPIREPDF-3820
Implements the function of extracting PDF text according to paragraph line.
PdfDocument doc = new PdfDocument();
// load PDF documents
doc.loadFromFile(InputPath);
doc.getConvertOptions().setKeepParagraph(true);
File file = new File(OutputPath);
file.createNewFile();
FileWriter fw = new FileWriter(file, true);
BufferedWriter bw = new BufferedWriter(fw);
StringBuilder builder = new StringBuilder();
PdfPageBase pageBase;
for (int i = 0; i < doc.getPages().getCount(); i++) {
pageBase = doc.getPages().get(i);
builder.append(pageBase.extractText(false) + "\r\n");
}
bw.write(builder.toString());
bw.flush();
bw.close();
fw.close();
doc.close();
New Feature SPIREPDF-3874 Implements read/write XMP meta data.
PdfDocument pdf=new PdfDocument();
pdf.loadFromFile("C:/test.pdf");
//Get Xmp meta data
String lcXml = pdf.getXmpMetaData().getXmlString();
PdfDocument newDoc=new PdfDocument();
newDoc.getPages().add();
//Write Xmp meta data to PDF
newDoc.getXmpMetaData().load(lcXml);
newDoc.saveToFile("C:/new.pdf");
Bug SPIREPDF-3808 Fixes the issue that the application threw an error "Parameter 'emSize 0.0 is invalid'" when converting PDF to Image.
Bug SPIREPDF-3827 Fixes the issue that content format was inconsistent when converting PDF to Excel.
Bug SPIREPDF-3846 Fixes the issue that image opacity was lost when printing a PDF containing a transparency image.
Bug SPIREPDF-3855 Fixes the issue that part content was missing when converting PDF to Word.
Bug SPIREPDF-3879 Fixes the issue that cloning page content failed.
Bug SPIREPDF-3894 Fixes the issue that the content became an image when converting PDF to Excel.
Bug SPIREPDF-3897 Fixes the issue that some items list was misaligned when converting PDF to Docx.
Bug SPIREPDF-3913 Fixes the issue that font memory could not be freed correctly.