List Resource Fonts in a PDF document

Q: How can I list all the resource fonts in a PDF document? A: Here is a sample Java code to list all fonts referenced in a PDF document using Qoppa’s jPDFProcess library. Some fonts may only be referenced by name and other fonts may be embedded in the document. In version v2016R1, a new […]

Read More

Rotate Pages in a PDF document using Java

This Java sample code will open a PDF and rotate each page of the document by a 180 degrees. It then prints and saved the rotated PDF document to a different file. This sample uses jPDFProcess, Qoppa’s Java PDF library to manipulate PDF documents. package jPDFProcessSamples;   import com.qoppa.pdf.PrintSettings; import com.qoppa.pdfProcess.PDFDocument; import com.qoppa.pdfProcess.PDFPage;   public […]

Read More

Create and add PDF annotations to a PDF document with jPDFProcess

Here is a sample Java program showing how to create and add annotations such as square, rubber stamp, typewriter, callout and free text to a PDF document using Qoppa’s PDF library jPDFProcess. The annotations are added to the first page of a PDF document. A first PDF is saved with all the annotations and a […]

Read More

Invalid CMAP name when rendering or printing a PDF page

Q: When opening a PDF file, I get the following error: A: You are missing cmaps.jar in your classpath which contains CMaps, used to read and display character encodings used with CJK (Chinese, Japanese, Korean) content. Download cmaps.jar   This error can happen when rendering PDF documents in Qoppa’s PDF components (jPDFViewer, jPDFNotes, jPDFEditor) or […]

Read More

Staple and Duplex options when printing PDF in Java

Q: Is it possible to specify staple & duplex options on a per-document basis with jPDFPrint? A: Yes, it is:  Java supports setting print job attributes for each print job, this is done through PrintRequestAttribute objects. jPDFPrint supports passing these attributes through. The attributes that you want to use are: javax.print.attribute.Finishings.STAPLEjavax.print.attribute.Finishings.STAPLE and javax.print.attribute.Sides.DUPLEXjavax.print.attribute.Sides.DUPLEX Here is a sample […]

Read More

Getting interactive field location information (bounds and page number)

To get PDF interactive form fields location information (including signature fields) such as dimension and page number, you will need to access the widget which is the visual representation of the field on the page. When using Qoppa’s PDF components (jPDFViewer, jPDFNotes, jPDFEditor), you can get information from the editing component. // get Acroform AcroForm […]

Read More

Adding custom properties to PDF digital signatures

Q: Is it possible to set custom properties to digital signatures using Qoppa’s PDF SDK? A: Yes, it is possible to do so using jPDFSecure, jPDFProcess or qPDF Toolkit. Adding custom property to the signature dictionary This method can be used to add additional custom properties to the signature dictionary. SigningInformation.setCustomProperty(key, value);SigningInformation.setCustomProperty(key, value); You can […]

Read More

How to hide the validation icon on signed digital signature fields

Q: Is there a way to turn off digital signature validity when rendering a PDF page in Qoppa’s PDF components and libraries? Our application will perform our own internal signature validation. A: Yes, it is possible by simply making a call to the following static method (before loading the signed PDF): PDFRenderHints.setRenderSignatureVerification(false);PDFRenderHints.setRenderSignatureVerification(false); This method sets […]

Read More

Adding a background or foreground image to a PDF page

Here is a sample Java program showing how to add background and foreground images to pages of a PDF document while still keeping all original page content as vector, i.e, the page still contain text, images and any vector drawing commands. This sample uses Qoppa’s PDF library jPDFProcess. This sample program opens a source PDF, […]

Read More

Add text content to a PDF document with Java

Here is a sample code to add text to a PDF document content using Qoppa’s Java PDF Library, jPDFProcess. import java.awt.Color; import java.awt.Font; import com.qoppa.pdfProcess.PDFDocument; import com.qoppa.pdfProcess.PDFGraphics; import com.qoppa.pdfProcess.PDFPage;   public class AddText { public static void main (String [] args) { try { // load PDF document PDFDocument pdfDoc = new PDFDocument ("C:\\myfolder\\input.pdf", null); […]

Read More

jPDFProcess v2015R2 Build Notes

v2015R2 Download Links v2015R2.10 – October 13 2016 JPDF-853 – Fill and do not stroke text highlight shape v2015R2.09 – August 19 2016 JPDF-839 – Make Root Page Tree Node Kids Array safe to null entry v2015R2.08 – August 11 2016 JPDF-811 – Error encountered trying to merge tag structure information due to ParentTree entry […]

Read More

Creating Searchable PDF from Image Files

Q: Can we convert images files into searchable PDF documents, by performing OCR, using Qoppa’s Java PDF library? A: Yes, using jPDProcess, you can do that. 1. Convert Images to PDF Pages The first step is to create a PDF from the images: // create a new PDF document PDFDocument pdfDoc = new PDFDocument(); // […]

Read More

No Tiff Writer Available Exception when Converting PDF to Tiff

Q: I am using jPDFProcess to convert PDF to TIFF and getting the following exception. How can I resolve this exception? A: You need to add the jai image libraries in the classpath. jai_imageio.jar and jai_codec.jar are jar files that contain Java’s ImageIO image encoders and decoders, needed for reading and writing JPEG 2000 and TIFF files.

Read More

PDF OCR With Multiple Languages

To call OCR with multiple languages, for instance English and French, call: com.qoppa.ocr.TessJNI.performOCR("eng+fra", myPage, 200); com.qoppa.ocr.TessJNI.performOCR("eng+fra", myPage, 200);

Read More

New Languages Supported in OCR

v2015R2 added OCR support for non-Latin and CJK languages. New Latin languages have also been added to the available list of languages. Here is a complete list of newly added OCR languages: New OCR Languages: Afrikaans Albanian – shqip Arabic – العربية Azerbaijani – azərbaycan Basque – euskara Belarusian – беларуская Bengali – বাংলা Bulgarian […]

Read More

LiveCycle Dynamic XFA Forms Support in Qoppa’s PDF Library

LiveCycle XFA forms are complex and uncommon PDF forms that are designed to be rendered dynamically from the drawing and layout information present in the XFA definition. This kind of forms are not widely supported and only a couple of vendors are able to render them. Adobe has moved away from dynamic XFA forms and […]

Read More

What individual libraries are included in jPDFProcess?

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 […]

Read More

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 […]

Read More

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 […]

Read More

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 […]

Read More

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 […]

Read More

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 […]

Read More

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 […]

Read More