Q: I read that jPDFProcess includes the functionality found in many of Qoppa’s individual libraries. What does that mean exactly? A: The following libraries are included in the distribution and licensing of jPDFProcess: jPDFAssemble jPDFFields jPDFImages jPDFPrint jPDFSecure jPDFText These libraries all derive from the main library jPDFProcess and were packaged separately to make it […]
Category: jPDFProcess: Create/Manipulate PDFs
Developer library to create, print and manipulate PDF documents in Java. This library encompasses the functionality found in most of our other libraries.
How to identify blank pages in a PDF programmatically
One way to tell if a page is empty in a PDF document is to look at the number of drawing commands on the page. If there is zero command then the page is perfectly empty, which usually means it was programmatically generated to be blank. But sometimes a page can contain a scanned image […]
ANT Task to Run PDF Processes
Yes, you can define jPDFProcess functions as ANT tasks, and process PDF documents from your ANT processes or workflows. Following is an implementation of two sample ANT tasks: an ant task to convert a PDF page to an image an task to apply a digital signature to a PDF it is very easy to add […]
J2EE Server – Servlet to Run PDF Processes
Qoppa’s Java PDF library jPDFProcess can be used directly from a Java Servlet, to process PDF requests. The following sample illustrates this, the servlet loads a PDF document from the file system, adds a watermark to it and then serves the document directly to the client browser: ServletSample.java It would be very easy to add […]
J2EE Server Rest API to Run PDF Processes
Qoppa’s Java PDF library jPDFProcess can be packaged as a REST API and then deployed to any J2EE server to provide RESTful services. See below. If you are looking for an-easy to install solution, Qoppa Software also offers a Restful API Module as part of Qoppa’s PDF Automation Server that be installed and started by […]
Command Line to Run PDF Processes
Qoppa’s PDF library jPDFProcess can be used from within a Java command line program, to provide any of its functions through command line options. By implementing in this way, PDF processing through jPDFProcess can be called from any other application or process to provide PDF functions. To implement the CLI program, a small Java application […]
Is jPDFWeb included in jPDFProcess?
Q: Is jPDFWeb included in jPDFProcess? A: No, jPDFWeb is licensed separately from jPDFProcess.
Is jOfficeConvert included in jPDFProcess?
Q: Is jOfficeConvert included in jPDFProcess? A: No, jOfficeConvert is licensed separately from jPDFProcess.
Is jPDFOptimizer included in jPDFProcess?
Q: Is jPDFOptimizer included in jPDFProcess? A: No, jPDFOptimizer is licensed separately from jPDFProcess.
Print Settings (margins, rotation, centering,..) when printing PDF in Java
Q: When we print PDF documents using Qoppa’s library jPDFPrint or components (jPDFViewer, jPDFNotes or jPDFEditor), how can I adjust the print margins? I want the printed page to be exactly the same as when printing with Adobe® Reader®’s. A: We spend a lot of time making sure that our printouts match Adobe Reader / […]
Code Sample: Merge 2 PDF files into one in Java using jPDFProcess
This Java program merges two PDF files into a single one using Qoppa’s PDF library jPDFProcess. // Load the two documents PDFDocument pdfDoc1 = new PDFDocument ("input1.pdf", null); PDFDocument pdfDoc2 = new PDFDocument ("input2.pdf", null); // Append the second document to the first one pdfDoc1.appendDocument(pdfDoc2); // Save the merged document pdfDoc1.saveDocument ("output.pdf");// Load the […]
How to add OCR to jPDFProcess
jPDFProcess, Qoppa’s java PDF creation and manipulation library, has an OCR module. Please contact us regarding licensing this additional feature. How to Activate / Implement OCR To get started, you can download the latest jPDFProcess version from here: https://www.qoppa.com/pdfprocess/demo/download And the JNI native bridge files from here: https://www.qoppa.com/files/pdfprocess/ocr/libtessjni411.zip The JNI zip file contains the […]
Linearizing existing PDF documents with Java
Q: Can Qoppa’s Java PDF library, jPDFProcess, create linearized PDF documents and save existing PDF documents as linearized? A: Yes, jPDFProcess can create linearize PDF documents. To linearize a PDF document with jPDFProcess, 2 simple lines of code do the trick: PDFDocument myPDF= new PDFDocument(“file.pdf”); myPDF.saveDocumentLinearized(new FileOutputStream(“linearizedfile.pdf”));PDFDocument myPDF= new PDFDocument(“file.pdf”); myPDF.saveDocumentLinearized(new FileOutputStream(“linearizedfile.pdf”)); What is PDF linearization and why […]
Saving PDF for Fast Web View Display when streaming
Q: Is there a way to save a PDF optimized for web reading in a way that the the 1st pages of a PDF can be displayed immediately to the user screen while the rest of the PDF continues loading? A: You can use our PDF library jPDFProcess to save PDF documents as “linearized”. Linearized documents contain […]
PDF overlay and imposition
Q: How can I generate a PDF document from overlaying one PDF document on another? We’re trying to overlay our company’s letterhead onto existing documents. A: Our Java PDF library jPDFProcess can overlay one document on top of another. The function to look at is called appendPageContent and is found at the PDFPage level. Note that the […]
jPDFProcess Java API
Q: Where can I find jPDFProcess javadoc API? A: You can find the API specification for the latest version of our library jPDFProcess on our website at this link. jPDFProcess is a java library to modify and manipulate PDF documents in Java.
Code Sample: Print a PDF document in Java using jPDFProcess
A simple Java program that prints a PDF document using Qoppa’s PDF library jPDFProcess. // Load document PDFDocument pdfDoc = new PDFDocument ("input.pdf", null); // Print the document pdfDoc.print("my printer", null);// Load document PDFDocument pdfDoc = new PDFDocument ("input.pdf", null); // Print the document pdfDoc.print("my printer", null); Download Full Java Sample to Print PDF in […]
Code Sample: Getting links from a PDF
Links are saved as part of the annotations in a PDF document even though they are not really considered annotations. Links in a PDF document do not specifically have a destination. Instead, they are more general, they hold a list of actions that can really be anything. We define actions that we support in the com.qoppa.android.pdfViewer.actions […]
Code Sample: Flatten PDF Interactive Form Fields in Java
This Java program “flattens” field data into the PDF content layer using Qoppa’s PDF library jPDFProcess. This means that the field contents will become part of the PDF content and so the document will not be editable anymore. Click here to view java code. jPDFProcess supports many PDF functions to work with PDF documents within Java. […]
Code Sample: Create PDF with embedded files
This java program create a single page PDF document and adds 3 embedded files within the PDF document as file attachments usinghttp://www.qoppa.com/files/pdfprocess. http://www.qoppa.com/pdfprocess/guide/sourcesamples/FileAttachments.java
Code Sample: Convert PDF to Tiff in Java
This Java program converts a PDF file to a multi-page TIFF file using Qoppa’s library jPDFProcess. package jPDFProcessSamples; import java.io.FileOutputStream; import com.qoppa.pdf.TIFFOptions; import com.qoppa.pdfProcess.PDFDocument; public class PDFToTIFF { public static void main (String [] args) { try { PDFDocument pdfDoc = new PDFDocument ("input.pdf", null); TIFFOptions options = new TIFFOptions (150, TIFFOptions.TIFF_PACKBITS); FileOutputStream outStream = […]
Code Sample: Add watermark to PDF document in Java
This Java program adds a semi-transparent watermark to a PDF document using Qoppa’s library jPDFProcess. You can change the watermark string, the font and size, the color, the location (x, y) and the rotation. // Load PDF document PDFDocument pdfDoc = new PDFDocument ("input.pdf", null); // Font is Helvetica 64 Font wmFont = PDFGraphics.HELVETICA.deriveFont(64f); […]
Code Sample: Add a bookmark for every page of a PDF document with java
This Java programs adds a bookmark for every page in a PDF document using Qoppa’s library jPDFProcess. // Load the document PDFDocument pdfDoc = new PDFDocument ("input.pdf", null); // Get the root bookmark, create one if necessary Bookmark rootBK = pdfDoc.getRootBookmark(); if (rootBK == null) { rootBK = pdfDoc.createRootBookmark (); } // Add a […]
Add a Table of Content (TOC) to a PDF document with Java
This Java program creates a table of contents at the head of the document using Qoppa’s PDF library jPDFProcess. This sample adds a page at the top of the document and then adds a page title and a link to every page in the document. Click here to view the java code.
Code Sample: Convert Tiff to PDF in Java using flate, JBIG2 or JPEG compression
A Java program that converts a TIFF file into a PDF document using Qoppa’s library Java PDF image library jPDFImages. TIFF images cannot be inserted directly into a PDF, so we have to read them into an image object and then recompress. Using Flate Compression This sample below is the simplest way to convert a multi […]
Code Sample: Add PDF Bookmarks
Working with Bookmarks jPDFAssemble and jPDFProcess allow to create new bookmarks or manipulate existing bookmarks in PDF documents. Here is an example on how to add bookmarks for each page of a PDF document: // Get current bookmark root Bookmark rootBK = pdfDoc.getRootBookmark(); // Create a root bookmark if it’s null if(rootBK == null) { rootBK = […]
Java PDF OCR library sdk
Qoppa offers a PDF OCR solution for Java which supports most languages, including English, German, French, and Spanish as well as Chinese, Japanese and Korean. It is available for Windows®, Mac OS X® and Linux®, in 32 and 64 bit. This is a clean, production-level Java integration of the well-known Tesseract engine with Qoppa’s own advanced […]
Running in non-GUI / non windowing servers
Q: I am getting the following error when running your library jPDFPrint in our SunOS environment. How can I fix it? Exception in thread "main" java.lang.InternalError: Can’t connect to X11 window server using ‘localhost:0.0’ as the value of the DISPLAY variable. at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method) at sun.awt.X11GraphicsEnvironment.<clinit>(X11GraphicsEnvironment.java:134) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:62) at sun.awt.motif.MToolkit.<clinit>(MToolkit.java:81) […]
JavaScript Support in Java PDF Libraries and Components
Q: Does Qoppa’s PDF library products support JavaScript? A: Yes, Qoppa’s Java PDF SDK API has support JavaScript. How is JavaScript used in PDF documents? Mostly, JavaScript is used in interactive PDF forms in field actions to calculate the value of fields, validate field data to prevent invalid entry and format special fields such as dates, […]