How to compress and pack existing PDF

Discussions about PDF management.
Post Reply
User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

How to compress and pack existing PDF

Post by Loïc » Sat Dec 24, 2011 12:42 pm

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();

lbleicher
Posts: 16
Joined: Fri Nov 04, 2011 4:51 am

Re: How to compress and pack existing PDF

Post by lbleicher » Fri Jan 13, 2012 10:31 pm

Hi Loic-

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

Thanks,
Leo

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: How to compress and pack existing PDF

Post by Loïc » Mon Jan 16, 2012 7:16 pm

Hello Leo,

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

Kind regards,

Loïc

lbleicher
Posts: 16
Joined: Fri Nov 04, 2011 4:51 am

Re: How to compress and pack existing PDF

Post by lbleicher » Mon Jan 16, 2012 8:21 pm

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

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: How to compress and pack existing PDF

Post by Loïc » Sat Feb 18, 2012 2:15 pm

Hello Leo,

See: viewtopic.php?t=3594

Kind regards,

Loïc

mvest
Posts: 1
Joined: Thu Dec 18, 2014 11:36 am

Re: How to compress and pack existing PDF

Post by mvest » Thu Dec 18, 2014 11:39 am

Hello,

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

Thank you,
Mickael Vest.

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: How to compress and pack existing PDF

Post by Loïc » Thu Dec 18, 2014 12:07 pm

Hello,

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

Cheers,

Loïc

Gabriela
Posts: 436
Joined: Wed Nov 22, 2017 9:52 am

Re: How to compress and pack existing PDF

Post by Gabriela » Wed Nov 22, 2017 12:07 pm

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

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 1 guest