Page 1 of 1

How to compress and pack existing PDF

Posted: Sat Dec 24, 2011 12:42 pm
by Loïc
Hello,

Here a simple example demonstrating how to configure the GdPicturePDF class for compression & packing.

This is quite simple, stable & fast... What else ? :)


Code: Select all

            GdPicturePDF oGdPicturePDF = new GdPicturePDF();
            oGdPicturePDF.LoadFromFile(@"c:\input.pdf", false);
            oGdPicturePDF.EnableCompression(true);
            oGdPicturePDF.SaveToFile(@"c:\compressed.pdf", false);
            oGdPicturePDF.SaveToFile(@"c:\compressed_pack.pdf", true);
            oGdPicturePDF.EnableCompression(false);
            oGdPicturePDF.SaveToFile(@"c:\uncompressed.pdf", false);
            oGdPicturePDF.SaveToFile(@"c:\uncompressed_pack.pdf", true);
            oGdPicturePDF.CloseDocument();

Re: How to compress and pack existing PDF

Posted: Fri Jan 13, 2012 10:31 pm
by lbleicher
Hi Loic-

This is handy, but how does one control the type and amount of compression applied by this method?

Thanks,
Leo

Re: How to compress and pack existing PDF

Posted: Mon Jan 16, 2012 7:16 pm
by Loïc
Hello Leo,

What do you mean by "type and amount of compression applied " ?

Kind regards,

Loïc

Re: How to compress and pack existing PDF

Posted: Mon Jan 16, 2012 8:21 pm
by lbleicher
Hi Loic-

Various types of compression (the best example being jpeg) allow for various trade-offs between compression and quality of image. The code you provided does not address which compression type will be applied (jpeg, jpeg2000 etc) or the quality level. Does it rely on defaults? If so which ones?

Thanks,
Leo

Re: How to compress and pack existing PDF

Posted: Sat Feb 18, 2012 2:15 pm
by Loïc
Hello Leo,

See: viewtopic.php?t=3594

Kind regards,

Loïc

Re: How to compress and pack existing PDF

Posted: Thu Dec 18, 2014 11:39 am
by mvest
Hello,

Does GdPicture (v10 or 11) support MRC compression please ?

Thank you,
Mickael Vest.

Re: How to compress and pack existing PDF

Posted: Thu Dec 18, 2014 12:07 pm
by Loïc
Hello,

Yes in version 11 (currently Beta). Link: viewtopic.php?t=4665

Cheers,

Loïc

Re: How to compress and pack existing PDF

Posted: Wed Nov 22, 2017 12:07 pm
by Gabriela
Here you can find updated code snippet based on GdPicture.NET 14:

Compressing and packing existing PDF documents
https://www.gdpicture.com/guides/gdpicture/web ... ents.html