//--------------------------------------------------------------------------------------- // Copyright (c) 2001-2025 by Apryse Software Inc. All Rights Reserved. // Consult legal.txt regarding legal and license information. //--------------------------------------------------------------------------------------- #include #include #include #include #include #include #include "../../LicenseKey/CPP/LicenseKey.h" using namespace std; using namespace pdftron; using namespace Filters; using namespace PDF; using namespace SDF; using namespace Common; // 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 // int main(int argc, char *argv[]) { PDFNet::Initialize(LicenseKey); try { PDFDoc pdf_doc("../../TestFiles/US061222892-a.pdf"); pdf_doc.InitSecurityHandler(); SDFDoc& cos_doc = pdf_doc.GetSDFDoc(); int num_objs = cos_doc.XRefSize(); for(int i=1; i