When running Qoppa Java PDF library jPDFOptimizer to optimize a PDF document and reduce its file size, it is possible to get optimization results of all performed functions as an object called OptimiseResults which allows to programmatically analyze the results and/or output them to a console or to an XML file. Output Optimizer Results to […]
Category: jPDFOptimizer: Optimize PDFs, Reduce PDF Files Size
Developer library to optimize PDF documents and reduce the size of PDF files in Java.
Auditing a PDF for Optimizing (Analyze Objects and Sizes)
Before optimizing a PDF file, it can be useful to audit the PDF to identify what objects are present in the PDF (such as images, fonts, document info, bookmarks, links, content streams, etc…) and what significant is their size in the document. In v2017R1, jPDFOptimizer added an audit function to do just this. // Load […]
Create, Merge and Convert PDF documents with Mule in an automated Worklow
Qoppa’s Java PDF libraries can be used within Mule ESB to automate PDF document processes within a workflow. PDF files can be transmitted as an input stream to any of our Java libraries. Follow the detailed steps showing how to integrate Qoppa’s PDF library jPDFProcess within a Mule flow. The following PDF functions available in […]
Invalid colors for CMYK images when cmykProfile.jar missing in classpath
Update: As of version v2019R1, cmykProfile.jar is now packaged inside Qoppa’s library jars and no longer requires to be added to the 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, […]
2016-08 v2016R1 jPDFOptimizer Release & Build Notes
First Release Date: August 17 2016 Version number: v2016R1 Java PDF Library: jPDFOptimizer Note: There may be a few API differences between this version and the previous one because Qoppa’s jPDFOptimizer library is now compiled in Java 6 and make use of Generics. It is important to bring the new jars into your IDE and […]
jPDFOptimizer v2015R2 Build Notes
v2015R2.01 – June 06 2016 jPDF-768 – Black section when compressing JPEG images with ICC color spaces or CMYK color spaces with Java 1.8 at a specific DPI v2015R2.01 also includes all fixes that made it into the build for Qoppa’s PDF engine.
Compressing images to JPEG2000 sometimes logs a “Target bitrate too low” exception
Q: We are using jPDFOptimizer and converting images in PDF document to JPEG2000 format. Could you please explain why we sometimes see the following error in the log? When this happens, the outptut optimized PDF is still fine. java.lang.IllegalArgumentException: Overall target bitrate too low, given the current bit stream header overhead at jj2000.j2k.entropy.encoder.EBCOTRateAllocator.initialize(EBCOTRateAllocator.java:564) at com.sun.media.imageioimpl.plugins.jpeg2000.J2KImageWriter.write(J2KImageWriter.java:370)java.lang.IllegalArgumentException: […]
Definition of the jPEG2000 Quality parameter in jPDFOptimizer
Q: How is the quality parameter defined when using JPEG2000 compression in jPDFOptimizer? This is the sample code I am using to compress existing images to JPEG2000 within PDF documents using jPDFOptimizer. imageoutput.setCompression(ImageOutput.CO_JPEG2000); imageoutput.setCompressionQuality(0.8f);imageoutput.setCompression(ImageOutput.CO_JPEG2000); imageoutput.setCompressionQuality(0.8f); The quality setting for JPEG200 compression is used to calculate the data rate (bits per pixel). The range for this […]
How to set the quality parameter when optimizing PDFs using JPEG or JPEG2000 compression
Q: We are using jPDFOptimizer, your Java library to optimize PDF documents. We are getting inconsistent results when compressing using JPEG2000 with the quality parameter. Sometimes the images are well compressed with a quality of 0.8, sometimes we have to use a quality of 0.2 for what appears to be the same results. A: This […]
Why are inline images not optimized in PDF documents
Sometimes you will noticed that images contained in the original PDF document were not optimized and remained as is in the output optimized PDF document. Most likely these images are inline images and Qoppa’s jPDFOptimizer library will not optimize inline images. The reason for this is found in the definition and usage recommended for inline […]
Is jPDFOptimizer included in jPDFProcess?
Q: Is jPDFOptimizer included in jPDFProcess? A: No, jPDFOptimizer is licensed separately from jPDFProcess.
Code Sample: Simple Java program to optimize a PDF file
A simple implementation of the library to open a PDF document, optimize it and save it to a new file using Qoppa’s java library jPDFOptimizer. import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; import com.qoppa.pdfOptimizer.ImageHandler; import com.qoppa.pdfOptimizer.ImageInfo; import com.qoppa.pdfOptimizer.ImageOutput; import com.qoppa.pdfOptimizer.OptSettings; import com.qoppa.pdfOptimizer.PDFOptimizer; /** * * SimpleOptimize is a sample program to demonstrate the capabilities of * Qoppa’s PDF […]
jPDFOptimizer Java API
Q: Where can I find jPDFOptimizer javadoc API? A: You can find the API specification for the latest version of our library jPDFOptimizer on our website at this link. jPDFOptimizer is a java library to optimize PDF documents in Java.
Optimizing a PDF using advanced optimization settings
Qoppa’s 100% Java PDF optimizer library, jPDFOptimizer, allows to optimize the content of a PDF document. Here are some advanced optimization options to reduce the size of a PDF document. OptSettings options = new OptSettings(); // Other optimizing options options.setFlattenComments(true); options.setFlattenFields(true); options.setClearSignatures(true); options.setFlateUncompressedStreams(true); options.setMergeDuplicateFonts(true); options.setMergeDuplicateImages(true); Method Description Flatten CommentsOptSettings.setFlattenComments() Flattens all annotations including text […]
Optimizing a PDF by removing unnecessary objects
Qoppa’s 100% Java PDF optimizer library, jPDFOptimizer, allows, among other things, to remove unnecessary objects in a PDF document in order to reduce the file size. This is done using the OptSettings class. OptSettings options = new OptSettings(); // Options to remove objects options.setDiscardAltImages(true); options.setDiscardAnnotations(true); options.setDiscardBookmarks(true); options.setDiscardDocumentInfo(true); options.setDiscardFileAttachments(true); options.setDiscardFormFields(true); options.setDiscardJSActions(true); options.setDiscardLinks(true); options.setDiscardPageThumbnails(true); options.setDiscardUnusedResources(true); options.setDiscardXMPData(true);OptSettings options […]
Optimizing images in a PDF document: compression, color space and resolution
Qoppa’s 100% Java PDF optimizer library, jPDFOptimizer, allows, among other things, to change the properties of images in a PDF document including the compression, the color space, and the DPI resolution. This is done using the ImageHandler interface and implementing the convertImage() method which allows an application to define optimization option per image or per […]
PDF is slightly bigger than original after compression
There are 2 most common reasons that you may obtain an output PDF that is bigger than the original PDF after optimization. Object Compression In a PDF document, the reference table – which is the table that indicates where each objects is located in the file – can be compressed as what is known as […]
Library to optimize PDF documents