Spire. PDF for Java

Spire. PDF for 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: 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<Object> values = new ArrayList<Object>();
    HashMap<String, PdfApplicationData> dic = info.getApplicationDatas();
    for (Map.Entry<String, PdfApplicationData> 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<String, PdfApplicationData> dic2 = infor2.getApplicationDatas();
    for (Map.Entry<String, PdfApplicationData> 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

Version: 4.10.2

Category ID Description
New feature - Supports extracting tables from PDF files.
PdfDocument pdf = new PdfDocument();
pdf.loadFromFile(inputFile);
StringBuilder builder = new StringBuilder();
//Extract the table
PdfTableExtractor extractor = new PdfTableExtractor(pdf);
PdfTable[] tableLists = null;
for (int pageIndex = 0; pageIndex < pdf.getPages().getCount(); pageIndex++) {
    tableLists = extractor.extractTable(pageIndex);
    if (tableLists != null && tableLists.length > 0) {
        for (PdfTable table : tableLists) {
            int row = table.getRowCount();
            int column = table.getColumnCount();
            for (int i = 0; i < row; i++) {
                for (int j = 0; j < column; j++) {
                    if (j == 0) {
                        builder.append(table.getText(i, j));
                    } else {
                        String text = table.getText(i, j);
                        builder.append(text + " ");
                    }
                }
                builder.append("\r
");
            }
        }
    }
}
FileWriter fileWriter = new FileWriter(outputFile);
fileWriter.write(builder.toString());
fileWriter.flush();
fileWriter.close();
Bug SPIREPDF-3952 Fixes the issue that the font size was changed after converting PDF to Excel.
Bug SPIREPDF-4653 Fixes the issue that the content was incorrect after converting PDF to PDFA2A.
Bug SPIREPDF-4681 Fixes the issue that the value of the "keyword" property could not be deleted.
Bug SPIREPDF-4691 Fixes the issue that setColorSpace method could not set parameters.

Version: 4.9.5

Category ID Description
New feature SPIREPDF-4568 Supports setting padding for grid cells.
PdfGridCell pdfGridCell = grid.getRows().get(1).getCells().get(0);
pdfGridCell.getStyle().setCellPadding(new PdfPaddings(10,10,10,10));
Bug SPIREPDF-3855 Fixes the issue that the content was missing after converting PDF to Word.
Bug SPIREPDF-4548 Fixes the issue that the stamp was missing after converting PDF to HTML.
Bug SPIREPDF-4554 Fixes the issue that the images were missing after converting PDF to PDFA1A.
Bug SPIREPDF-4591 Fixes the issue that the application threw the error "NullPointerException" when loading the file.
Bug SPIREPDF-4605 Fixes the issue that setting the transparent color did not take effect.
Bug SPIREPDF-4595 Fixes the issue that the inserted image was not displayed correctly.
Bug SPIREPDF-4608 Fixes the issue that setting the vertical alignment of grid cell text to center did not take effect.
Bug SPIREPDF-4618 Fixes the issue that the application threw the error "NullPointerException" when getting the PDF pages.
Bug SPIREPDF-4656 Fixes the issue that the application threw the error "NullPointerException" when setting the JavaScript action of the PDF.

Version: 4.8.7

Category ID Description
New feature - Supports converting PDF to OFD.
pdf.saveToFile(output, FileFormat.OFD)
Bug SPIREPDF-3985 Fixes the issue that the fonts were incorrect after converting PDF to Word.
Bug SPIREPDF-4146 Fixes the issue that the content was missing after converting PDF to Word.
Bug SPIREPDF-4324 Fixes the issue that the application threw the error "Value cannot be null" when converting PDF to PDFA1A.
Bug SPIREPDF-4342 Fixes the issue that an image was missing after converting PDF to PDFA1A/PDFA1B.
Bug SPIREPDF-4358 Fixes the issue that the application threw the error "NullPointerExcetion" when replacing fonts in  PDF files.
Bug SPIREPDF-4359 Fixes the issue that the application threw the error "type is not supported" when replacing fonts in PDF files.
Bug SPIREPDF-4464 Fixes the issue that the output file name was incorrect after converting PDF to HTML.
Bug SPIREPDF-4473 Fixes the issue that the generated file did not conform to the standard of PDFA1B after converting PDF to PDFA1B.
Bug SPIREPDF-4478 Fixes the issue that an error prompted when opening the result file after adding digital signatures to PDF.
Bug SPIREPDF-4486 Fixes the issue that the it returned null when getting the locale after finding text.
Bug SPIREPDF-4493 Fixes the issue that the barcode added to PDF couldn't be recognized.
Bug SPIREPDF-4522 Fixes the issue that the application threw the error "NullPointerExcetion" when converting PDF to PDFA1A.
Bug SPIREPDF-4527 Fixes the issue that the signing time was incorrect when opening the result file in Foxit Reader after adding digital signatures.
Bug SPIREPDF-4530 Fixes the issue that the application threw the error "type is not supported" when getting the used fonts.
Bug SPIREPDF-4542 Fixes the issue that the application threw the error "IllegalArgumentExcep" when drawing the grid.

Version: 4.7.8

Category ID Description
Bug SPIREPDF-4318 Fixes the issue that the content format was incorrect after converting PDF to Word.
Bug SPIREPDF-4332 SPIREPDF-4411 Fixes the issue that the application threw the error "Has no define cmap char" when extracting text from PDF.
Bug SPIREPDF-4355 Fixes the issue that the setExportTextOCRHandler method failed to pass images.
Bug SPIREPDF-4407 Fixes the issue that the content was incorrect after converting PDF to PDF/A1A.
Bug SPIREPDF-4443 Fixes the issue that the generated image was blank after converting PDF to images.
Bug SPIREPDF-4451 Fixes the issue that the application threw the error "NullPointerException" when extracting text from PDF.
Bug SPIREPDF-4458 SPIREPDF-4461 Fixes the issue that the file size of the resulting files was too large after splitting the PDF file.

Version: 4.6.8

Category ID Description
New feature SPIREPDF-4350 Supports saving PDF documents to stream after merging.
PdfDocumentBase pdfDocumentBase = PdfDocument.mergeFiles(inputFiles);
pdfDocumentBase.save(outputStream);
Bug SPIREPDF-4243 Fixes the issue that the content was incorrect after converting PDF to images.
Bug SPIREPDF-4298 Fixes the issue that the application threw the error "StackOverflowError" when replacing images in PDF files.
Bug SPIREPDF-4314 Fixes the issue that the output file couldn't be opened normally after converting PDF to Excel stream.

Version: 4.5.10

Category ID Description
Bug SPIREPDF-4260 Fixes the issue that the content of the PDF document was lost after adding the watermark.
Bug SPIREPDF-4257 Fixes the issue that it failed to fill the field of the PDF/A document.
Bug SPIREPDF-4233 Optimizes the size of the generated file when converting PDF to HTML.

Version: 4.4.8

Category ID Description
New feature SPIREPDF-4194 Adds a new method to remove JavaScript scripts.
PdfDocument pdf = new PdfDocument();
pdf.loadFromFile(input);
pdf.removeDocumentJavaScript();
pdf.saveToFile(output, FileFormat.PDF);
Bug SPIREPDF-4104 Fixes the issue that the extracted text was incorrect.