Spire.Office for Java 3.6.4

Spire.Office for Java 3.6.4 is released

We're pleased to announce the release of Spire.Office for Java 3.6.4. This version has some fantastic new features. For example, Spire.XLS supports setting the type of hyperlink and converting Excel to HTML, Spire.Doc improves the printing quality, Spire.PDF supports converting HTML to PDF with QT plugin, and so on. Besides, some issues that occurred when loading, converting and manipulating Word, Excel, PPT and Presentation files are also fixed successfully. More details about new features and issues are listed below.

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

Here is a list of changes made in this release

Spire.XLS for Java

Category ID Description
New Feature SPIREXLS-2148 Supports that only formula values are retained when copying cells.
Worksheet sheet = workbook.getWorksheets().get(0);
CopyRangeOptions copyOptions = CopyRangeOptions.OnlyCopyFormulaValue;
sheet.copy(sheet.getCellRange("A6:E6"), sheet.getCellRange("A8:E8"), EnumSet.of(copyOptions));
New Feature SPIREXLS-2156 Supports converting Excel to HTML.
workbook.saveToFile(filename,FileFormat.HTML)
New Feature SPIREXLS-2090 Supports setting the type of hyperlink.
hyperlink.setType(HyperLinkType.File);
Bug SPIREXLS-2265 Fixes the issue that name of cell lost when copying sheet.
Bug SPIREXLS-2332 Fixes the issue that the application threw NullPointerException while converting Excel to Images.
Bug SPIREXLS-2336 Fixes the issue that the method cellRange.hasMerged() returned an incorrect result.
Bug SPIREXLS-2157 Fixes the issue that the created BubbleChart didn't have correct format.
Bug SPIREXLS-2159 Fixes the issue that the chart that created from pivot table didn't have correct format.
Bug SPIREXLS-2290 Fixes the issue that the application threw NullPointerException when converting XLS to XML.
Bug SPIREXLS-2357 Fixes the issue that bold style of text was inforrect after converting Excel to PDF.
Bug SPIREXLS-2392 Fixes the issue that caused incorrect format of chart after converting Excel to image.
Bug SPIREXLS-2393 Fixes the issue that the data lost after sorting cellrange of sheet.
Bug SPIREXLS-2407 Fixes the issue that caused incomplete content after converting Excel to image.
Bug SPIREXLS-2420
SPIREXLS-2437
Fixes the issue that the application threw the "Index is less than 0 or more than or equal to the list count" when converting Excel to image on Centos.
Bug SPIREXLS-2420 Fixes the issue that after converting Excel to XML, the generated XML promupted that the file was corrupted when opening.
Bug SPIREXLS-2438 Fixes the issue that the application threw NullPointerException when converting Excel to PDF in multiple threads.

Spire.Doc for Java

Category ID Description
New Feature SPIREDOC-3682
SPIREDOC-3763
Improves printing quality.
Document loDoc = new Document(inputFile);
PrinterJob loPrinterJob = PrinterJob.getPrinterJob();
PageFormat loPageFormat  = loPrinterJob.defaultPage();
Paper loPaper = loPageFormat.getPaper();
//remove the default printing margins
loPaper.setImageableArea(0,0,loPageFormat.getWidth(),loPageFormat.getHeight());
//set the number of copies
loPrinterJob.setCopies(1);
loPageFormat.setPaper(loPaper);
loPrinterJob.setPrintable(loDoc,loPageFormat);s
 try {
         loPrinterJob.print();
     } catch (PrinterException e)
 {
         e.printStackTrace();
       }
Bug SPIREDOC-3961 Fixes the issue that the extracted math formula value was incorrect.
Bug SPIREDOC-3973 Fixes the issue that it was added a blank page when converting Word to PDF.
Bug SPIREDOC-4368 Fixes the issue that the application threw an error "Unknown format".
Bug SPIREDOC-4132 Fixes the issue that some content lost when loading and then resaving the document.
Bug SPIREDOC-4460 Fixes the issue that the application threw an error"Attempted to read past the end of the stream".
Bug SPIREDOC-4465 Fixes the issue that the application threw an error"NullPointerException".
Bug SPIREDOC-4468 Fixes the issue that the application threw an error"Invalid data" when using MathML Code to create OfficeMath.
Bug SPIREDOC-4483 Fixes the issue that the application threw an error"No have this value 115"when converting Word to PDF .
Bug SPIREDOC-4459 Fixes the issue that the application threw the "ClassCastException" when updating TOC.
Bug SPIREDOC-4482 Fixes the issue that the application threw the "KeyNotFoundException" when converting Word document to PDF.
Bug SPIREDOC-4497 Fixes the issue that the application threw the "IndexOutOfBoundsException" when inserting the TOC.
Bug SPIREDOC-4502 Fixes the issue that the application threw the "NullPointerException" when loading the document.
Bug SPIREDOC-4506 Fixes the issue that the application threw the exception "Attempted to read past the end of the stream" when loading the document.
Bug SPIREDOC-4560 Fixes the issue that the application threw the exception "OLE stream in not valid" when loading the document.
Bug SPIREDOC-4562 Fixes the issue that the application threw the "ArrayIndexOutOfBoundsException" when removing the section break.
Bug SPIREDOC-4566 Fixes the issue that the application threw the exception "No have this Word97Color" when loading the document.
Bug SPIREDOC-4585
SPIREDOC-4594
SPIREDOC-4598
Fixes the issue that the content of the table was incorrect when converting Word document to PDF.
Bug SPIREDOC-4596 Fixes the issue that the characters overlapped when converting Word document to PDF.
Bug SPIREDOC-4600 Fixed the issue that the text was cut off when converting Word document to PDF.
Bug SPIREDOC-4602 Fixes the issue that the application threw the exception "No have this MathJustification" when loading the document.
Bug SPIREDOC-4608 Fixes the issue that the application threw the "NullPointerException" when loading the document.
Bug SPIREDOC-4610 Fixes the issue that the application threw the "NullPointerException" when converting Word document to PDF.
Bug SPIREDOC-4613 Fixes the issue that the application threw the "ArrayOutOfBoundsException" when removing the section break.
Bug SPIREDOC-4613 Fixes the issue that the application threw the exception "No have this value 142" when loading the document.

Spire.Presentation for Java

Category ID Description
Bug SPIREPPT-1073 Fixes the issue that the chart data of the resulting document could not be accessed after changing the chart data.
Bug SPIREPPT-1155 Fixes the issue that it failed to get font size of table.
Bug SPIREPPT-1170 Fixes the issue that the content was incorrect when converting SmartArt to images.
Bug SPIREPPT-1170 Fixes the issue that the content was not full when converting arrow shape to images.
Bug SPIREPPT-1185 Fixes the issue that the application threw OutOfMemoryError when converting PPT to image.
Bug SPIREPPT-1196 Fixes the issue that gradient colors were incorrect when converting PPT to image.
Bug SPIREPPT-1197 Fixes the issue that the application was hung when converting PPT to image.

Spire.PDF for Java

Category ID Description
New Feature SPIREPDF-2187
SPIREPDF-2606
SPIREPDF-2961
Supports converting HTML to PDF with QT plugin.
String url = "http://www.wikipedia.org/";
String fileName = "D:/output.pdf";
String pluginPath = "D:/Qt/plugins_64";
HtmlConverter.setPluginPath(pluginPath);
HtmlConverter.convert(url,fileName);
New Feature SPIREPDF-3261 Adds the method "setExportTextOCRHandler" to support calling external OCR API to extract text from image when extracting PDF text.
IOCR loIOCR=(image)->{
    String extractedText = "";
    //OCR API
    //extractedText = ...
    return extractedText;
};
PdfDocument.setExportTextOCRHandler(loIOCR);
PdfDocument pdf=new PdfDocument();
pdf.loadFromFile(inputPath);
String text = "";
for (PdfPageBase page : (Iterable) pdf.getPages()) {
    text += page.extractText();
}
FileWriter sw = new FileWriter(outputPath);
sw.write(text);
sw.flush();
sw.close();
pdf.close();
New Feature SPIREPDF-3274 Supports setting the username and password of the timestamp server when digitally signing a PDF document.
String url = "https://freetsa.org/tsr";
signature.configureTimestamp(url,"user_name","password");
Bug SPIREPDF-3186 Fixes the issue that the signature information was not displayed correctly when digitally signing a PDF document.
signature.removeShowConfigureText(SignatureConfigureText.Distinguished_Name);
Bug SPIREPDF-3208 Fixes the issue that the application threw the "OutOfMemoryError" when extracting images from PDF document.
Bug SPIREPDF-3241 Fixes the issue that the content of Word document was lost after converting from PDF to Word.
Bug SPIREPDF-3277 Fixes the issue that the application threw the "NullPointerException" when extracting text from PDF document.
Bug SPIREPDF-3298 Fixes the issue that the application threw the exception "The request timed out" when digitally signing a PDF document on CentOS.
Bug SPIREPDF-3303 Fixes the issue that the image color became dark when loading the image using BufferedImage.
Bug SPIREPDF-3317 Fixes the issue that the application threw the "OutOfMemoryError" when converting PDF to image.