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 […]
Articles Tagged: optimize
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 […]