Spire.PDF-for-Java
Spire.PDF-for-Java copied to clipboard
Spire.PDF for Java is a PDF component that enables to read, write, print and convert PDF documents in Java applications without using Adobe Acrobat.
Spire.PDF-for-Java-JAVA Library for Processing & Manipulating PDF Files
Product Page 丨 Documentation 丨 Examples 丨 Forum 丨 Temporary License 丨 Customized Demo
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).
PDF Processing Features
- Extract images, text, pages and attachments from a PDF document with great speed and accuracy.
- 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.
- Encrypt/Decrypt PDF, and verify,add/delete digital signatures in PDF.
- Add /update/delete PDF bookmarks.
- Insert hyperlink in PDF.
- Merge/split PDF.
- Add tables to the PDF and compress PDF document.
- Add/remove/fill fields and create/fill in formfield in PDF.
- Draw text/image/shape/barcode to the PDF.
Conversions
- Convert PDF to PDF/A
- Convert PDF to Image
- Convert PDF to SVG
- Convert SVG to PDF
- Convert PDF to XPS
- Convert XPS to PDF
- Convert PDF to Word
- Convert PDF to HTML
- Convert PDF to EXCEL
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
Convert PDF to DOC in Java
//create a PdfDocument object
PdfDocument doc = new PdfDocument();
//load a sample PDF file
doc.loadFromFile("C:\\Users\\Administrator\\Desktop\\Introduction of Spire.PDF for Java.pdf");
//save as .doc file
doc.saveToFile("output/ToDoc.doc",FileFormat.DOC);
//save as. docx file
doc.saveToFile("output/ToDocx.docx",FileFormat.DOCX);
doc.close();
}
Convert PDF to images in Java
//Create a PdfDocument instance
PdfDocument pdf = new PdfDocument();
//Load a PDF sample document
pdf.loadFromFile("sample.pdf");
//Loop through every page
for (int i = 0; i < pdf.getPages().getCount(); i++) {
//Convert all pages to images and set the image Dpi
BufferedImage image = pdf.saveAsImage(i, PdfImageType.Bitmap,500,500);
//Save images to a specific folder as a .png files
File file = new File("C:\\Users\\Administrator\\Desktop\\PDFToImages" + "/" + String.format(("ToImage-img-%d.png"), i));
ImageIO.write(image, "PNG", file);
}
pdf.close();
}
}
Convert PDF to HTML in Java
//Load the PDF file
PdfDocument pdf = new PdfDocument();
pdf.loadFromFile("New Zealand.pdf");
//Save to HTML format
pdf.saveToFile("ToHTML.html", FileFormat.HTML);
}
}
Product Page 丨 Documentation 丨 Examples 丨 Forum 丨 Temporary License 丨 Customized Demo
