Spire.PDF for Java

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

  • Overview
  • Features
  • Support
  • What's New
  • Live Demo

Professional Java Library
to Process PDF Documents

Over 1,000,000 Developers Are Already Using Our Libraries
To Create Their Amazing Applications.

Spire.PDF for Java is a PDF API that enables Java applications to read, write and save PDF documents without using Adobe Acrobat. Using this Java PDF component, developers and programmers can implement rich capabilities to create PDF files from scratch or process existing PDF documents entirely on Java applications (J2SE and J2EE).

Many rich features can be supported by Spire.PDF for Java, such as security settings, extract text/image from the PDF, merge/split PDF, draw text/image/shape/barcode to the PDF, create and fill in form fields, add and delete PDF layers, overlay PDF, insert text/image watermark to the PDF, add/update/delete PDF bookmarks, add tables to the PDF, compress PDF document etc. Besides, Spire.PDF for Java can be applied easily to convert PDF to XPS, XPS to PDF, PDF to SVG, SVG to PDF,PDF to Excel, PDF to Word, PDF to HTML, HTML to PDF and PDF to PDF/A in high quality.

  • Convert

  • Compress

  • Extract

  • Protect

  • eSign

  • Form

  • Watermark

  • Merge & Split

  • Layer

  • Adjust

Convert PDF to Word

PDF is considered an ideal file format for document sharing and printing, but it is difficult to edit. If you want to modify the text in a PDF file, you can convert it to Word.

Compress PDF

Compressing PDFs can reduce their size by 10 to 100 times, thus saving you a lot of storage space and making PDF documents easier to transfer over the Internet.

Extract Text and Images

When you just need to get the information in a PDF document regardless of its format and structure, you can simply extract the text and images from the document.

PDF Encryption

PDF encryption is a crucial task when it comes to sharing confidential documents on the Internet. Using Spire.PDF, you can set a password to restrict access to your PDF file, or set permissions to define what actions users can perform on the document.

Digitally Sign PDF

A digital signature provides assurances about the validity and authenticity of your PDF documents. Once a PDF document is digitally signed, any changes to the document will invalidate the signature.

Create a Form

Form fields make it easier to collect information. Users can enter information by choosing an item from a drop-down list, inserting text in a combo box, or checking a check box.

Add a Watermark to PDF

Watermarks in PDFs serve many important purposes, such as identifying the document's owner, indicating its status and preventing unauthorized copying and distribution.

Merge and Split PDF

Sometimes, you might need to merge multiple PDF files into one in order to store and review them easier. Likewise, you may also want to split a PDF file into individual files and share them with others separately.

Add Layers to PDF

PDF layer is an interactive feature for PDF documents that allows some part of the content to be made visible or hidden. Layers are used for items such as CAD drawings, layered artwork, maps, and multi-language documents.

Change PDF Page Size

By adjusting the page size of a PDF document, you can easily get a better document appearance or make the page size match the printing paper.


A totally independent Java PDF library.

It does not require Adobe Acrobat or any other 3rd party software/library installed on system.


  • PDF 1.2 to PDF 1.7
  • PDF/A - 1b
  • PDF/x1a
  • PDF/A1
  • PDF/A2
  • PDF/A3
  • PDF/UA


  • 14 Core Fonts
  • Type 1 Fonts
  • Type 3 Fonts
  • CJK Fonts
  • True Type Fonts
  • Unicode Support


Powerful Toolset, Multichannel Support

  • Create, get and verify, remove digital signature

  • Encrypt and Decrypt PDF file

  • Image and Shape

  • Create & Fill Form Field

  • Merge and Split PDF document

  • Manage attachment

  • Manage bookmark

  • Manage annotation

  • Text & image watermark

  • Find & Highlight

  • Insert Hyperlink

  • Compress PDF

  • Extract text and image

  • Header and Footer

  • Create & Format Table

  • Print PDF file

  • Tagged PDF


Conversion File Documents with High Quality

  • SVG

  • TXT

  • XPS

  • HTML

  • Image


  • PPTX

  • Excel

  • Word

  • PCL

  • PDF/A

  • PNG

  • BMP

  • JPEG

  • EMF

  • TIFF


Only Spire.PDF for Java,
No Adobe Acrobat installed

Spire.PDF for Java is a totally independent Java PDF library. It does not require Adobe Acrobat or any other 3rd party software/library installed on system.

Easily Manipulate document and Form fields

Spire.PDF for Java supports to draw text/image/table/barcode and shape on the PDF document from scratch, extract text and image from the PDF file, create/fill in/delete PDF form fields, add text and image watermarks to PDF, add/update/delete PDF bookmarks, operate hyperlinks/attachments/annotations on the PDF, add image/text stamp to PDF document.

Document Settings features

Document information can be set with Spire.PDF for Java including document properties, viewer preference such as page orientation, page size, and zoom factor.

High Quality PDF File Conversion

Spire.PDF for Java supports to convert PDF to XPS, PDF to Image, PDF to SVG, SVG to PDF, PDF to Excel, XPS to PDF, PDF to PDF/A with high quality.

Security Features

Spire.PDF for Java supports to add PDF digital signatures and verify the signatures on the PDF documents, encrypt and decrypt the PDF document, change PDF security permission and detect whether a signed PDF is changed or not.

Easy Integration

Spire.PDF for Java can be easily integrated into Java applications (J2SE and J2EE).

Commercial Edition $999

Compared with the Free Spire.PDF for Java, the commerical edition of Spire.PDF for Java supports many more features while operating the PDF documents, such as extracting image from PDF, converting PDF to SVG, and converting XPS to PDF.

Free Edition $0

Free Spire.PDF for Java is a 100% free PDF API that enables Java applications to read, write and save PDF documents without using Adobe Acrobat.


Free Trials for All Progress Solutions

Here is a brief summary of Spire.PDF for Java features.

Support Environment

  • 100% Written in Java
  • Supports 32-bit and 64-bit OS
  • Works on Windows, Linux, Unix and Mac OS
  • Supports PDF Version 1.2, 1.3, 1.4, 1.5, 1.6 and 1.7
  • No Need to Install Additional Software










Header and Footer



  • Add Action
  • Add Javascript Action
  • Add Action Chain




We guarantee one business day Forum questions Reply.

We guarantee one business day E-mail response.

Free Customized service for OEM Users.

Skype name: iceblue.support

Apply for a Free Trial License File.

If you have tried out Spire.PDF and found it useful, please consider sharing your experience with others. By sharing your testimonial with us, you will not only help others to make the right decision but will also to earn rewards from us. Please send your testimonials to sales@e-iceblue.com.

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: 10.2.6

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.

Version: 10.2.0

Category ID Description
Bug SPIREPDF-6465 Fixes the issue that the creation time obtained from a PDF document was wrong.
Bug SPIREPDF-6503 Fixes the issue that redrawing extracted images to a page failed
Bug SPIREPDF-6504 Fixes the issue that the document size did not change after deleting some pages.
Bug SPIREPDF-6522 Fixes the issue that the program throws java.lang.ArrayIndexOutOfBoundsException when using PDFTextReplacer in multiple threads.

Version: 10.1.9

Category ID Description
New feature SPIREPDF-6479 Adds two new methods for decrypting PDFs.
PdfDocument pdf1 =new PdfDocument();

PdfDocument pdf2 =new PdfDocument();
Bug SPIREPDF-6429 Fixes the issue that the program threw "java.lang.NullPointerException" when converting OFD to PDF.
Bug SPIREPDF-6482 Fixes the issue that the program hung when converting PDF to images.
Bug SPIREPDF-6485 Fixes the issue that the content was lost after converting OFD to PDF.
Bug SPIREPDF-6486 Fixes the issue that the program threw "java.lang.NullPointerException" when converting PDF to XLSX.
Bug SPIREPDF-6502 Fixes the issue that the content was garbled after replacing text.

Version: 10.1.5

Category ID Description
Bug SPIREPDF-6484 Fixes the issue that no resulting documents were generated after performing batch text replacement on multiple PDF documents under multi-threading.

Version: 10.1.3

Category ID Description
New feature SPIREPDF-6454 Improves the efficiency of drawing watermarks.
New feature SPIREPDF-6459 Adds the PdfTextReplacer interface to implement text replacement function.
PdfDocument pdf = new PdfDocument();
PdfPageBase page = pdf.getPages().get(0);
PdfTextReplacer replacer = new PdfTextReplacer(page);
PdfTextReplaceOptions options= new PdfTextReplaceOptions();
replacer.replaceText("www.google.com", "1234567");
New feature - Adds the PdfImageHelper interface to implement image deletion, extraction, replacement, and compression functions.

Key code snippet:
PdfImageHelper imageHelper = new PdfImageHelper();
PdfImageInfo[] imageInfoCollection= imageHelper.getImagesInfo(page);
Delete image: 
Extract image:
    int index = 0;
    for (com.spire.pdf.utilities.PdfImageInfo img : imageInfoCollection) {
        BufferedImage image = img.getImage();
        File output = new File(outputFile_Img + String.format("img_%d.png", index));
        ImageIO.write(image, "PNG", output);
Replace image:
PdfImage image = PdfImage.fromFile("ImgFiles/E-iceblue logo.png");
imageHelper.replaceImage(imageInfoCollection[i], image);
Compress image:
for (PdfPageBase page : (Iterable)doc.getPages())
            if (page != null)
                if (imageHelper.getImagesInfo(page) != null)
                    for (com.spire.pdf.utilities.PdfImageInfo info : imageHelper.getImagesInfo(page))
Bug SPIREPDF-6468 Fixes the issue that the program threw java.lang.StringIndexOutOfBoundsException exception when saving documents.

Version: 9.11.3

Category ID Description
Bug SPIREPDF-5830 Fixes the issue that extracting the contents of tables in PDF failed.
Bug SPIREPDF-6315 Fixes the issue that the content was drawn repeatedly when converting PDF to PPTX on Ubuntu system.
Bug SPIREPDF-6323 Fixes the issue that the program threw "No 'DCWGQU+CambriaMath' font found!" when converting PDF to Word on Linux system.
Bug SPIREPDF-6359 Fixes the issue that the binding direction of the cover was incorrect when creating a booklet.
Bug SPIREPDF-6364 Fixes the issue that the program threw "PDF file structure is not valid" exception when loading PDF.
Bug SPIREPDF-6389 Fixes the issue that the program threw "NullPointerException" when using the appendPage() method to merge PDF documents.

Version: 9.10.3

Category ID Description
New feature - Synchronizes the new encryption and decryption interface to Java, and supports configuring the AES encryption algorithm.
//Create password security policies
PdfSecurityPolicy securityPolicy = new PdfPasswordSecurityPolicy("", "123456"); 
//Set AES encryption algorithm
securityPolicy.setEncryptionAlgorithm( PdfEncryptionAlgorithm.AES_256); 
//Set document permissions (ownership), default is ForbidAll.
PdfDocument pdf = new PdfDocument();
//Pass the open password to open the PDF document
pdf.loadFromFile(inputFile, "1234"); 
pdf.saveToFile(outputFile, FileFormat.PDF);
New feature SPIREPDF-6306 Supports setting the names of existing fields.
PdfDocument document=new PdfDocument();
PdfFormWidget formWidget = (PdfFormWidget)document.getForm();
for (int i = 0; i < formWidget.getFieldsWidget().getCount(); i++)
    PdfField field = (PdfField)formWidget.getFieldsWidget().get(i);
    for (PdfFieldWidget widget : (Iterable) formWidget.getFieldsWidget())
        if (widget.getName() == "oldName")
Fixes the issue that the background was incorrect after converting PDF to SVG.
Bug SPIREPDF-6275 Fixes the issue that the shape color was incorrect and the content was missing after converting PDF to PPTX.
Bug SPIREPDF-6277 Fixes the issue that images were obstructed after converting PDF to PPTX.
Bug SPIREPDF-6300 Fixes the issue that the standard validation failed after converting PDF to PDFA2B.
Bug SPIREPDF-6307 Fixes the issue that stamps were lost after converting OFD to PDF.
Bug SPIREPDF-6324 Fixes the issue that the program threw "NullPointerException" when loading PDF.

Version: 9.9.6

Category ID Description
New feature SPIREPDF-6082
Provides the XlsxSpecialTableLayoutOptions interface to optimize formatting when converting PDF with tables to Excel.
PdfDocument document=new PdfDocument();
XlsxSpecialTableLayoutOptions options=new XlsxSpecialTableLayoutOptions(false, false, false);
document.saveToFile("output.pdf", FileFormat.XLSX);
New feature SPIREPDF-6247 Supports converting PDF to SVGZ.
document.saveToFile("output.svgz", FileFormat.SVGZ);
New feature SPIREPDF-6249 Synchronized the function of comparing the contents of PDF documents to JAVA.
PdfDocument pdf1 = new PdfDocument(inputFile_1);
PdfDocument pdf2 = new PdfDocument(inputFile_2);
PdfComparer compare = new PdfComparer(pdf1, pdf2);
compare.getOptions().setPageRanges(0, pdf1.getPages().getCount() - 1, 0, pdf2.getPages().getCount() - 1);
Bug SPIREPDF-6252 Fixes the issue that the page size is inconsistent after converting PDF to SVG.
Bug SPIREPDF-6276 Fixes the issue that the text is duplicated after converting PDF to PPTX.
Bug SPIREPDF-6280 Fixes the issue that the program threw "PDF file structure is not valid" when loading PDF documents.
Bug SPIREPDF-6281 Fixes the issue that the program threw "NullPointerException" when signing PDF.

Version: 9.9.2

Category ID Description
Bug SPIREPDF-6241 Fixes the issue that the characters overlapped when converting OFD to PDF.

Version: 9.8.6

Category ID Description
Bug SPIREPDF-6104 Fixes the issue that some borders of charts were cropped after converting PDF to SVG.
Bug SPIREPDF-6133 Fixes the issue that the cell merge of the same column was incorrect after converting PDF to Excel.
Bug SPIREPDF-6209 Fixes the issue that setting fonts for text boxes didn't take effect.
Request free customized demo just for you.

Tab 1


Maximum file size: 1 MB. Files accepted: pdf.
Click here to browse files.

Convert to

Source file:
Target file type:

Tab 2


Maximum file size: 1 MB. Files accepted: pdf.
Click here to browse files.

Convert to

Source file:
Search Text:

Tab 3


Contact Company City Country Phone
Erica NormanKauai Dive ShoppeKapaa KauaiUS808-555-0269
George WeathersUniscoFreeportBahamas809-555-3915
Phyllis SpoonerSight DiverKato PaphosCyprus357-6-876708
Joe BaileyCayman Divers World UnlimitedGrand CaymanBritish West Indies011-5-697044
Chris ThomasTom Sawyer Diving CentreChristianstedUS Virgin Islands504-798-3022
Ernest BarrattBlue Jack Aqua CenterWaipahuUS401-609-7623
Russell ChristopherVIP Divers ClubChristianstedUS Virgin Islands809-453-5976
Paul GardnerOcean ParadiseKailua-KonaUS808-555-8231
Susan WongFantastique AquaticaBogotaColumbia057-1-773434
Joyce MarshMarmot Divers ClubKitchenerCanada416-698-0399
Sam WitherspoonThe Depth ChargeMarathonUS800-555-3798
Theresa KunecBlue SportsGiribaldiUS610-772-6704
Donna SiausMakai SCUBA ClubKailua-KonaUS317-649-9098
Michael SpurlingAction ClubSarasotaUS813-870-0239
Barbara HarveyJamaica SCUBA CentreNegrilWest Indies011-3-697043
Desmond OrtegaIsland FindersSt Simons IsleUS713-423-5675
Gloria GonzalesAdventure UnderseaBelize CityBelize011-34-09054
Harry BathboneBlue Sports ClubLargoUS612-897-0342
Lloyd FellowsFrank's Divers SupplyEugeneUS503-555-2778
Tanya WagnerDavy Jones' LockerVancouverCanada803-509-0112
Robert MichelindSCUBA HeavenNassauBahamas011-32-09485
Frank PaniaguaShangri-La Sports CenterFreeportBahamas011-32-08574
Charles LopezDivers of Corfu, Inc.Ayios MatthaiosGreece30-661-88364
Rudolph ClausKirk EnterprisesHoustonUS713-556-6437
Bill WyersGeorge Bean Co.LugoffUS803-438-2771
Shirley MathersProfessional Divers, Ltd.HooverUS205-555-8333
Nancy BeanDivers of Blue-greenPelhamUS205-555-7184
Elaine FallsGold Coast SupplyMobileUS205-555-2640
Patricia O'BrienSan Pablo Dive CenterSanta MariaUS823-044-2910
Dave WallingUnderwater Sports Co.San JoseUS408-867-0594
Lynn CinciripiniAmerican SCUBA SupplyLomitaUS213-654-0092
Nicole DupontCatamaran Dive ClubCatalina IslandUS213-223-0941
Peter OwenDiver's GrottoDowneyUS213-432-0093
Bethan LewisFisherman's EyeGrand CaymanBritish West Indies809-555-4680
Marianne MilesAction Diver SupplySt. ThomasUS Virgin Islands22-44-500211
Stephen BryantMarina SCUBA CenterCaracasVenezuela58-33-66222
Christine TaylorBlue Glass HappinessSanta MonicaUS213-555-1984
Simone GreenDivers of VeniceVeniceUS813-443-2356
Bram PhillipsOn-Target SCUBAWinnipegCanada416-445-0988
Jonathan WestJamaica Sun, Inc.Runaway BayWest Indies809-555-2746
Grant AinsworthUnderwater FantasyOcho RiosWest Indies809-555-2214
Anne MariachiPrincess Island SCUBATaveuniFiji679-311923
Maria EventoshCentral Underwater SuppliesJohannesburgRepublic So. Africa27-11-4432458
Anna RackSafari Under the SeaGrand CaymanBritish West Indies809-409-4233
Isabelle NeeceLarry's Diving SchoolMilwaukieUS503-403-7777
Kevin RiderTora Tora ToraNassauBahamas809-898-0043
Susan SmithVashon VenturesHonoluluUS532-099-0423
Joe HatterDivers-for-HireSuvaFiji679-804576
Paul StillOcean AdventuresMauiUS776-868-9334
Michael GrossmanUnderwater SCUBA CompanySomersetBermuda809-555-1225
Gillian OwenAquatic DramaTampaUS613-442-7654
Brian MilesThe Diving CompanySt. ThomasUS Virgin Islands22-44-50098
Angela JonesNorwest'er SCUBA LimitedPagetBermuda778-123-0745
Richard HouserWaterspout SCUBA CenterPortlandUS503-654-2434
Louise FranksNeptune's Trident SupplyNegrilWest Indies778-897-3546



Tab 4


Maximum file size: 1 MB. Files accepted: pdf.Upload up to 3 files.
Click here to browse files.

Source file:

Target file type:

Tab 5


Maximum file size: 1 MB. Files accepted: pdf.
Click here to browse files.
Source file:

Set text watermark

Font Size:

Set image watermark

Click here to browse files

If you don't find the function you want, please fill in a form to request a free demo from us. Make sure the demo you want meets the following requirements:

  • It is a small project that implements a particular scenario.
  • It relates to our libraries stored on E-iceblue online store.
  • It costs less than 2 hours for us to complete it.
  • It is not a bug report.
  • It is not a feature request.