Invalid colors for CMYK images when cmykProfile.jar missing in classpath

When rendering or optimizing images with a CMYK color space (DeviceCMYK), Qoppa’s PDF libraries and components need the cmykProfile.jar to be present in the classpath. If you forget to include this jar, you will get images with “weird” colors. Faces for instance will show with more intense, bright saturated colors (such as red and blue) […]

Read More

Convert PDF document to PNG image files

This java program uses Qoppa’s jPDFImages to convert a PDF to PNG image files. A PNG image is created for each page contained in the PDF document. // open PDF document PDFImages pdfDoc = new PDFImages ("C:\\myfolder\\input.pdf", null); // loop through pages for (int count = 0; count < pdfDoc.getPageCount(); ++count) { // convert current […]

Read More

How to Resolve Error Rendering Page: Missing Font

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 the following error displayed on a page. This happens because the PDF document is calling for a font, ‘F0’ in this case, that is not embedded in the document […]

Read More

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

Read More

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

Read More

Export / Convert PDF Pages to Thumbnail Images with Java

Here is Java sample code to export PDF pages to images in various formats: PNG, JPG and TIFF using Qoppa’s PDF library jPDFImages. When opening the PDF document, the sample below read the document from a local file, the code can be simply changed to read the file from a file input stream instead. Export […]

Read More

Maximum Page Size / Resolution when converting a PDF to TIFF

Q: We are trying to export a PDF to TIFF using jPDFImages and are getting a Negative Array Size Exception. What could be the issue? Sample Code: public static void testPDFToTiff() throws Exception{ PDFImages pdf = new PDFImages("C:\\mydoc.pdf", null); TIFFOptions options = new TIFFOptions(300, TIFFOptions.TIFF_CCITT_T6); pdf.saveDocumentAsTIFF("C:\\mydoc.tif", options); }public static void testPDFToTiff() throws Exception{ PDFImages pdf […]

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

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

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

Packbits versus LZW compression for Tiff Images

Q: We are using jPDFImages to convert PDFs to Tiff and are using Packbits right now. Would the next best option be using LZW? What are the advantages and disadvantages of using LZW? A: Packbits compression is fast, widely-supported, and provides good results for scanned images. LZW provides more compression than Packbits but Packbits is […]

Read More

jPDFImages v2015R2 Build Notes and Download

Download jPDFImages.v2015R2.06.jar v2015R2.06 – June 15 2016 Added support for TrueType collections v2015R2.05 – June 8 2016 JPDF-776, JPDF-775 – Some fonts loading issues v2015R2.04 – May 23 2016 jPDF-762 – When importing TIFFs, default to 72 DPI when the data is “out of bounds”, that is: – If the resolution units in the TIFF […]

Read More

Is jPDFImages thread-safe?

Q: Once a PDFImages object is created, is it safe to share it between threads and call com.qoppa.pdfImages.PDFImages#savePageAsJPEG method from multiple threads on single object at once? A: Yes, PDFImages was developed to be thread-safe and for the same PDFImages object, i.e, for one PDF document loaded, it is safe to call savePageAsJEG from multiple […]

Read More

Export PDF Page as Image using CMYK or Custom Color Space

In version v2105R1, a new feature was added to our PDF to Image Conversion Library, jPDFImages,  that allows rendering a page in a PDF document to CMYK color space or to any custom color space. Previous versions of the library would only render to the RGB color space which is typical when rendering to a […]

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

Rendering to CMYK and Overprint Simulation

In version v2015R1, Overprint simulation was added to Qoppa’s Java PDF component jPDFEditor. This advance PDF technique is used by professionals in the print and pre-press industry. Overprint simulation allows to preview how two distinct colors that overlap will mix when printed.   RGB Rendering By default, Qoppa renders to RGB: To render to CMYK […]

Read More

Code Sample: Convert Tiff to PDF in Java

A Java program that converts a TIFF file into a PDF document using Qoppa’s library Java PDF image library jPDFImages. import com.qoppa.pdfImages.PDFImages; public class TIFFToPDF { public static void main (String [] args) { try { PDFImages pdfDoc = new PDFImages(); pdfDoc.appendTIFFAsPages("input.tif"); pdfDoc.saveDocument("output.pdf"); } catch (Throwable t) { t.printStackTrace(); } } }import com.qoppa.pdfImages.PDFImages; public class TIFFToPDF […]

Read More

jPDFImages Java API

Q: Where can I find jPDFImages javadoc API? A: You can find the API specification for the latest version of our library jPDFImages on our website at this link. jPDFImages is a java library to convert PDF documents to images and to create PDF documents from images in java.

Read More

Code Sample: Convert PDF page into BufferedImage in Java

A Java program that gets images from a PDF (one image per page) as Java BufferedImage objects using Qoppa’s library jPDFImages. Once images are available as BufferedImage objects, they can easily be modified before saving using Java Graphics2D. For instance here a watermark is applied to the images. http://www.qoppa.com/pdfimages/guide/sourcesamples/PDFToBufferedImages.java If your goal is only to add a watermark, you […]

Read More

Code Sample: Convert a PDF file to Tiff in java

A Java program to convert a PDF file to a single, multi-page TIFF file using Qoppa’s library Java PDF image library jPDFImages. import com.qoppa.pdf.TIFFOptions; import com.qoppa.pdfImages.PDFImages; public class PDFToTIFF { public static void main (String [] args) { try { PDFImages pdfDoc = new PDFImages ("input.pdf", null); TIFFOptions options = new TIFFOptions (150, TIFFOptions.TIFF_PACKBITS); pdfDoc.saveDocumentAsTIFF("output.tif", options); […]

Read More

Code Sample: Convert a PDF document to JPEG files in Java

This Java program converts a PDF file to multiple JPEG files using Qoppa’s library Java PDF image library jPDFImages. This program loops through the pages contained in a PDF document and outputs a JPEG image for each PDF page. In this program, the resolution is set to 150 dpi and the JPEG quality to 0.8. Both […]

Read More

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

Read More