//--------------------------------------------------------------------------------------- // Copyright (c) 2001-2008 by PDFTron Systems Inc. All Rights Reserved. // Consult legal.txt regarding legal and license information. //--------------------------------------------------------------------------------------- import pdftron.Filters.Filter; import pdftron.Filters.FilterReader; import pdftron.PDF.*; import pdftron.SDF.DictIterator; import pdftron.SDF.Obj; import pdftron.SDF.ObjSet; import pdftron.SDF.SDFDoc; // This sample project illustrates how to recompress bi-tonal images in an // existing PDF document using JBIG2 compression. The sample is not intended // to be a generic PDF optimization tool. // // You can download the entire document using the following link: // http://www.pdftron.com/net/samplecode/data/US061222892.pdf public class JBIG2Test { public static void main(String[] args) { PDFNet.initialize(); PDFNet.setResourcesPath("../../../resources"); try { PDFDoc pdf_doc=new PDFDoc("../../TestFiles/US061222892-a.pdf"); pdf_doc.initSecurityHandler(); SDFDoc cos_doc = pdf_doc.getSDFDoc(); int num_objs = (int)cos_doc.xRefSize(); for(int i=1; i