When rendering a PDF document in the following Qoppa’s PDF library products: jPDFImages, jPDFPrint, jPDFProcess, jPDFViewer, jPDFNotes or jPDFEditor, you might encounter a blank page with an “Error Rendering Page” displayed in red on a page. This error happens when there is an issue with a font within the PDF document. There are 2 possible […]
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.
Fill / Populate XFA Dynamic Form with Field Data in Java
Here is a sample Java program that can load a dynamic XFA form, fill in data from an XDP or XML file and then saved the filled form. This sample is using Qoppa’s PDF library jPDFFields. It could be simply adapted to use jPDFProcess library by replacing PDFFields with PDFDocument. import com.qoppa.pdfFields.PDFFields; public class […]
Copying pages from one PDF to another PDF in Java
Here is a sample Java program that shows how to copy pages from one PDF document to another using Qoppa’s PDF library jPDFProcess. The sample can be adapted to work with Qoppa’s jPDFAssemble by simply replacing the class “PDFDocument” with “PDFAssemble”. In this sample, we’re copying the pages from an existing PDF to a new […]
Export PDF to PNG Image with Overprint Simulation
This Java sample below shows how to use Qoppa’s jPDFImages (or jPDFProcess) to load a PDF and export it to an image in PNG format with overprint simulation on. First, the image is rendered in CMYK profile, then converted to RGB using ColorConvertOp and finally saved as PNG (or JPEG). The resolution is set at […]
On using Java RenderingHints to smooth jagged edges on rotated images
Q: There seems to be some pixelation or resolution issue when rendering specific images in a PDF brochure. Is there anything that can be done to render these images more smoothly? A: Qoppa’s PDF libraries and components uses our own interpolation algorithm that works much better than the built-in Java algorithm well both when up-sampling […]
Is it possible to send CAC certificates to the server for digital signature?
Q: We are developing a webserver solution which will be deployed on Internet Explorer for digitally signing PDF documents. We need to sign using the certificate on the users CAC Card. Is it possible to get the certificate from the client to the server for signature? A: If you are using a hardware device for […]
Getting information about the annotations contained in each page of a PDF document
Annotations are stored in a vector within each page of a PDF document. Here is sample code to loop through annotations contained in each page and output information about each annotation including annotation type, creator, date modified, color, bounds using Qoppa’s Java library jPDFProcess. This code can be adapted to work with Qoppa’s PDF components, […]
List of Supported JavaScript Events in Qoppa PDF Components
Here is the list of supported JavaScript events in Qoppa PDF Library and Component Products. Doc/Open Field/Keystroke Field/Validate Field/Calculate Field/Format Field/Focus Field/Blur Field/MouseEnter Field/MouseExit Field/MouseUp Field/MouseDown
List of Supported JavaScript Actions in Qoppa PDF Components
Here is the list of supported actions in Qoppa’s PDF Library and Component Products. The table below lists the JavaScript actions, where they live in the PDF document and if they are supported or not. Parent Dictionary Entry Supported/Unsupported Document Level: Names (in the Catalog dictionary) JavaScript Supported Catalog OpenAction Supported AA (additional actions […]
List of Supported JavaScript Objects / Methods / Properties in Qoppa PDF Components
Here is a list of all objects, methods and properties supported in Qoppa’s PDF Library and Component Products. This list was compiled for v2016R1. App Methods: alert beep openDoc popUpMenu popUpMenuEx response setTimeOut trustedFunction Properties: formsVersion viewerType viewerVersion Color Methods: equal Properties: black blue cyan dkGray gray green ltGray magenta red transparent white yellow Console […]
Extract Images from PDF Document using Java
Q: How can I export all the images contained in a PDF document? A: Here is a sample Java code to list all images embedded in a PDF document and save / export them using Qoppa’s jPDFProcess library. This example shows how to save the images in png format but it can simply be changed […]
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 […]
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 […]
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 […]
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 […]
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 […]
Create PDF Redaction Annotations and Burn / Apply Redaction Annotations Programmatically
Here is some Java sample code to add a new redaction annotation and then burn / apply it on a page of a PDF document using Qoppa’s PDF library jPDFProcess. Java Library to Add & Burn Redaction Annotations: jPDFProcess can redact text, images and shapes / path commands in PDF documents, it is extremely sophisticated […]
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 […]
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 […]
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 […]
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, […]
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); […]
jPDFProcess v2015R2 Build Notes
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 in StructTreeRoot being […]
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(); // […]
Extracting text content at a given location in a PDF (invoice, statement, medical record…)
When trying to automate processes, it can be necessary to identify and extract specific text strings contained in PDF documents such as invoices, statements, medical records or other business documents. Text is not structured in PDF documents so the best way to do this is done by identifying text by its location on the PDF […]
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.
Resizing or Scaling PDF Pages (Paper Size and Content) Programmatically in Vector Format
Q: Is there a way to resize a PDF in order to scale non-letter-size PDFs to 8.5 x 11 PDFs using Qoppa’s PDF library jPDFProcess? A: Yes, there is. Version v2017R1 and later jPDFProcess now has a direct API to resize pages in a PDF. Version v2016R1 and earlier In previous versions, it was possible […]
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);
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 […]
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. XFA Forms were deprecated in PDF 2.0 Adobe has […]