Spire. PDF for Java

Java PDF Library - Developing PDF in JavaJava PDF Library – Create Read Modify Print Convert PDF Documents in Java

Professional Java Library to process PDF documents

This is the list of changelogs of Spire.PDF for Java New release and hotfix. You can get the detail information of each version's new features and bug solutions.

Download Spire.PDF for Java to start a free trial:

Version: 8.6.8

Category ID Description
New feature SPIREPDF-4864
SPIREPDF-5223
Provides TextFindParameter.Regex enum type to support regular expression matching.
document.getPages().get(0).findText("", EnumSet.of(TextFindParameter.Regex)); 
New feature SPIREPDF-4936
SPIREPDF-5099
Provides new interface PdfOrdinarySignatureMaker to sign PDF.
String inputFile = "input.pdf";
String outputFile = "result.pdf";
String inputfile_img = "sign.png";
String inputFile_Pfx = "gary.pfx";
//load pdf
PdfDocument doc = new PdfDocument();
doc.loadFromFile(inputFile);
//load pfx file
PdfCertificate x509 = new PdfCertificate(inputFile_Pfx, "e-iceblue");
PdfOrdinarySignatureMaker signatureMaker = new PdfOrdinarySignatureMaker(doc, x509);
PdfSignature signature = signatureMaker.getSignature();
PdfSignatureAppearance appearance = new PdfSignatureAppearance(signature);
//set ImageAndSignDetail mode
appearance.setGraphicMode(GraphicMode.SignImageAndSignDetail);
//set signature content
appearance.setNameLabel("SSSSSSSSSS:");
signature.setName("Peekaboo");
appearance.setContactInfoLabel("Phone:");
signature.setContactInfo("028-81705109");
appearance.setDateLabel("Date: ");
appearance.setLocationLabel("Address: ");
signature.setLocation("ChengDu");
appearance.setReasonLabel("Cause");
signature.setReason("I am owner of ducument");
appearance.setSignImageLayout(SignImageLayout.Stretch);
appearance.setSignatureImage(PdfImage.fromFile(inputfile_img));
//define signature size and position and add it in PDF
for (int i = 0; i < doc.getPages().getCount(); i++)
{
    signatureMaker.makeSignature("Peekaboo_" + (i + 1), doc.getPages().get(i), (float)doc.getPages().get(i).getActualSize().getWidth() - 340, (float)doc.getPages().get(0).getActualSize().getHeight() - 150, 270, 100, appearance);
}
//save document
doc.saveToFile(outputFile);
doc.close();
Bug SPIREPDF-4768 Optimizes the time to convert PDF to Excel in Linux environment.
Bug SPIREPDF-4906 Fixes the issue that the bookmake didn't work after converting PDF to PDFA1A.
Bug SPIREPDF-5035 Fixes the issue that the order of found text was inconsistent with the order of text on the page.
Bug SPIREPDF-5172 Fixes the issue that caused black background after converting PDF to PDFA1A.
Bug SPIREPDF-5185 Fixes the issue that the text extracted from PDF had incorrect format.
Bug SPIREPDF-5217 Fixes the issue that the image was lost after merging PDF documents.
Bug SPIREPDF-5256 Fixes the issue that the image covered content after converting PDF to OFD.

Version: 8.5.8

Category ID Description
Bug SPIREPDF-4216 Fixes the issue that some texts repeated after converting PDF to Excel.
Bug SPIREPDF-4895 Fixes the issue that the text became an image after converting PDF to Excel.
Bug SPIREPDF-4994 Fixes the issue that some data were incorrect after converting PDF to Excel.
Bug SPIREPDF-5034 Fixes the issue that caused messy characters after converting PDF to Word.
Bug SPIREPDF-5052 Fixes the issue that the application threw exception when converting PDF to Word.
Bug SPIREPDF-5056 Fixes the issue that some contents were incorrect after converting PDF to PDF/A.
Bug SPIREPDF-5066 Fixes the issue that the row height narrowed after merging cells.
Bug SPIREPDF-5088 Fixes the issue that some contents were incorrect after converting PDF to Word.
Bug SPIREPDF-5111 Fixes the issue that the application threw the exception "Document element did not appear" when converting OFD to PDF in parallel.
Bug SPIREPDF-5117 Fixes the issue that caused extra space when drawing Arabic text and setting right alignment.
Bug SPIREPDF-5131
SPIREPDF-5144
Fixes the issue that the application threw the exception "(x+width)is outside of Raster" when converting PDF to Word.
Bug SPIREPDF-5133 Fixes the issue that the style of center alignment was lost after converting PDF to HTML.
Bug SPIREPDF-5143 Fixes the issue that the application threw the exception "Specified argument was out of the range of valid values" when drawing PDF grid.
Bug SPIREPDF-5149 Fixes the issue that caused incorrect table format after adding long text in cell.
Bug SPIREPDF-5153 Fixes the issue that the text exceeded the border after converting PDF to PDFA1B.
Bug SPIREPDF-5161 Fixes the issue that the application threw "NullPointerException" when embedding grid.
Bug SPIREPDF-5197 Fixes the issue that the application threw "No have this Height" when converting PDF to Word.

Version: 5.5.0

Category ID Description
Bug SPIREPDF-4998 Fixes the issue that the transparent background became white after converting PDF to image.
Bug SPIREPDF-5002 Fixes the issue that the application threw "Item has already been added. " when converting PDF to Word in multi-thread.
Bug SPIREPDF-5007 Fixes the issue that caused poor effect after converting Tiff to PDF.
Bug SPIREPDF-5023 Fixes the issue that the content format was incorrect after converting Svg to PDF.
Bug SPIREPDF-5044
SPIREPDF-5045
Fixes the issue that the application threw "NullPointerException" when converting PDF to Word.
Bug SPIREPDF-5049 Fixes the issue that the application threw "NumberFormatException" when converting PDF to Word.
Bug SPIREPDF-5055 Fixes the issue that the application threw "class com.spire.office.packages.sprnfma" when converting PDF to Word using flow method.
Bug SPIREPDF-5093 Fixes the issue that the application threw "Requested a name string that is not present in the font" when converting PDF to HTML.
Bug SPIREPDF-5110 Fixes the issue that the text format was incorrect after converting Ofd to PDF.

Version: 5.4.2

Category ID Description
New feature SPIREPDF-2425 Supports setting SignImageLayout.Stretch to make signature picture automatically fit the signature field size.
signature.setSignImageLayout(SignImageLayout.Stretch); 
Bug SPIREPDF-3925 Fixes the issue that the image background color was incorrect after adding a watermark. 
Bug SPIREPDF-5016 Fixes the issue that the application threw "NullPointerException" when converting PDF to PDFA3A.
Bug SPIREPDF-5030 Fixes the issue that the content was incorrect after converting PDF to PDFA3A
Bug SPIREPDF-5036 Fixes the issue that the output effect was incorrect after filling polygon
Bug SPIREPDF-5040 Fixes the issue that the content was lost after converting OFD to PDF.
Bug SPIREPDF-5042
SPIREPDF-5043
SPIREPDF-5048
SPIREPDF-5050
SPIREPDF-5051
Fixes the issue that the application threw "NumberFormatException" when converting PDF to Word.
Bug SPIREPDF-5074 Fixes the issue that the application threw "NullPointerException" when converting PDF to Word.

Version: 5.4.0

Category ID Description
Bug SPIREPDF-4966
SPIREPDF-5003
Fixes the issue that the Chinese characters were garbled after converting PDF to PDFA.
Bug SPIREPDF-4969 Fixes the issue that the application threw "NullPointerException" when converting PDF to word.
Bug SPIREPDF-4971 Fixes the issue that the application threw "ArrayIndexOutOfBoundsException" when converting PDF to PDFA repeatedly.
Bug SPIREPDF-4973 Fixes the issue that the application threw " Can't append a node created by another document" when converting PDF to OFD with multithreads.
Bug SPIREPDF-4978 Fixes the issue that the application threw " NullPointerException" when getting PDF first page.
Bug SPIREPDF-4992 Fixes the issue that the content format was incorrect after converting PDF to PDFA.
Bug SPIREPDF-5010 Fixes the issue that it was unable to set font for PdfCode128ABarcode bottom text.

Version: 5.3.1

Category ID Description
New feature SPIREPDF-4915 Supports converting a pdf to a grayscale document.
PdfGrayConverter converter = new PdfGrayConverter("ConvertToGrayPdf.pdf");
converter.toGrayPdf("output.pdf");
Bug SPIREPDF-4741 Fixes the issue that the obtained ComBoxField item value was incorrect.
Bug SPIREPDF-4873 Optimizes the memory releasing issue when converting PDF to PDFA1B.
Bug SPIREPDF-4926 Fixes the issue that the application threw "String index out of range" when getting PDF used fonts.
Bug SPIREPDF-4949 Fixes the issue that the format was incorrect after setting middle for both vertical alignment and horizontal alignment.
Bug SPIREPDF-4956 Fixes the issue that the application threw "OutOfMemoryError" after compressing images.
Bug SPIREPDF-4967 Fixes the issue that the obtained PDF conformance was incorrect.
Bug SPIREPDF-4974 Fixes the issue that the application threw "NullPointerException" when getting PDF image information.

Version: 5.2.3

Category ID Description
New feature SPIREPDF-4131 Supports converting TIFF files to PDF.
PdfDocument doc = new PdfDocument();
PdfPageBase page = doc.getPages().add();
PdfImage myTiff = PdfImage.fromFile("TiffToPdf.tiff");
page.getCanvas().drawImage(myTiff, 60, 60, 260, 150);
doc.saveToFile("output.pdf", FileFormat.PDF); 
New feature SPIREPDF-4892 Supports determining whether PDF file was password encrypted.
boolean isPasswordProtected = PdfDocument.isPasswordProtected(inputFile); 
New feature - Supports converting OFD format to PDF.
OfdConverter converter = new OfdConverter(inputFile);
converter.toPdf(outputFile); 
Bug SPIREPDF-4827 Fixes the issue that the content displayed incorrectly after converting PDF to image.
Bug SPIREPDF-4857 Fixes the issue that some content lost after converting PDF to Html.
Bug SPIREPDF-4863 Fixes the issue that the verification failed after converting PDF to PDFA1B.
Bug SPIREPDF-4877 Fixes the issue that the application threw "NullPointerException" when converting PDF to image.
Bug SPIREPDF-4888 Fixes the issue that the application threw "NullPointerException" when getting PDF attachments.
Bug SPIREPDF-4890 Fixes the issue that the application threw "NullPointerException" when finding PDF text. 
Bug SPIREPDF-4913 Fixes the issue that the application threw "NullPointerException" when converting PDF to PDFA2A.

Version: 5.1.0

Category ID Description
New feature SPIREPDF-4782 Supports printing by a specified printer.
//Specify the printer name to print
PrintSettings setting = pdf.getPrintSettings(); setting.setPrinter("Adobe PDF");
//Getsystem default printer
PrinterJob loPrinterJob = PrinterJob.getPrinterJob();
PrintService printer = loPrinterJob.getPrintService();
String PrinterName = printer.getName();
//set to use the current printer
loPrinterJob.setPrintService(printer);
New feature SPIREPDF-4829 Supports getting PDF PieceInfo dictionary information.
    PdfDocument pdf = new PdfDocument();
    pdf.loadFromFile(inputFile);
    StringBuilder sb = new StringBuilder();
    PdfPieceInfo info = pdf.getDocumentPieceInfo();
    ArrayList values = new ArrayList();
    HashMap dic = info.getApplicationDatas();
    for (Map.Entry item : dic.entrySet())
    {
        PdfApplicationData data = item.getValue();
        values.add(data.getPrivate());
        String content = data.getPrivate().toString();
    }
    PdfPageBase page = pdf.getPages().get(0);
    PdfPieceInfo infor2 = page.getPagePieceInfo();
    HashMap dic2 = infor2.getApplicationDatas();
    for (Map.Entry item2 : dic2.entrySet())
    {
        PdfApplicationData data2 = item2.getValue();
        if (data2.getPrivate() instanceof String) {
        String content = data2.getPrivate().toString();
    }
}


Bug SPIREPDF-4546 Optimized the the bold font was blurred after printing PDF. 
Bug SPIREPDF-4788 Fixes the issue that the application threw "ArrayIndexOutOfBoundsException" when loading PDF document.
Bug SPIREPDF-4798
SPIREPDF-4799
SPIREPDF-4800
SPIREPDF-4812
Fixes the issue that the content format was incorrect when converting PDF to Word document.
Bug SPIREPDF-4816 Fixes the issue that the picture of PDF file was not displayed correctly after compressing.
Bug SPIREPDF-4817 Fixes the issue that the saved stream was incorrect when converting PDF to SVG.
Bug SPIREPDF-4841 Fixes the issue that it needed an open password when using WPS to open the PDF that only set a permission password.
Bug SPIREPDF-4842 Fixes the issue that it was unable to get the PDF used fonts.

Version: 4.12.1

Category ID Description
New feature SPIREPDF-4781 Supports that the text of cell is not wrapped when converting PDF to Excel file
//The fourth parameter controls whether the text is wrapped
doc.getConvertOptions().setPdfToXlsxOptions(new XlsxLineLayoutOptions(false, false, false, false));
New feature - Supports converting PDF to linearized PDF.
PdfToLinearizedPdfConverter converter = new PdfToLinearizedPdfConverter(inputPath);
converter.toLinearizedPdf(OutputPath); 
Bug SPIREPDF-4760 Fixes the issue that the application threw an error "java.lang.NullPointerException" when copying page content
Bug SPIREPDF-4770 Fixes the issue that the application threw an error "java.lang.ClassCastException" when copying page content
Bug SPIREPDF-4771 Fixes the issue that the application threw an error "java.lang.NullPointerException" when converting to PDFA file
Bug SPIREPDF-4774 Fixes the issue that converting PDF to OFD stream failed
Bug SPIREPDF-4789 Fixes the issue that the image content was incorrect after compressing the images in PDF file
Bug SPIREPDF-4794 Fixes the issue that there was extra space on the right side of the converted OFD document page

Version: 4.11.1

Category ID Description
New feature SPIREPDF-4734 Supports converting PDF to images with transparent background.
PdfDocument doc = new PdfDocument();
doc.loadFromFile("input.pdf");
doc.getConvertOptions.setPdfToImageOptions(0);
BufferedImage image = doc.saveAsImage(0); 
Bug SPIREPDF-3907 Fixes the issue that the content was truncated when converting PDF to Word
Bug SPIREPDF-4113
SPIREPDF-4638
SPIREPDF-4651
Fixes the issue that the application hanged when converting PDF to images
Bug SPIREPDF-4588
SPIREPDF-4743
Fixes the issue that the application threw NullPointerException
Bug SPIREPDF-4612 Fixes the issue that the format was incorrect after adding text in grid cell
Bug SPIREPDF-4663 Fixes the issue that the size of the images obtained was incorrect
Bug SPIREPDF-4706 Fixes the issue that the application threw "String index out of range: 4" when converting PDF to Word
Bug SPIREPDF-4713 Fixes the issue that the application threw "Value cannot be null" when loading a PDF file
Bug SPIREPDF-4714 Fixes the issue that setting cell newlines did not work
Bug SPIREPDF-4729 Fixes the issue that the application threw "ClassCastException" when merging PDFs
Bug SPIREPDF-4735 Fixes the issue that the content was incorrect after splitting a PDF document
Bug SPIREPDF-4755 Fixes the issue that the application threw "NumberFormatException" when merging PDFs