Loading...

How to compress and pack existing PDF

Support for GdPicturePDF Plugin.

How to compress and pack existing PDF

Postby 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();
Loïc Carrère, support team.
www.orpalis.com
User avatar
Loïc
Site Admin
 
Posts: 4437
Joined: Tue Oct 17, 2006 10:48 pm
Location: France

Re: How to compress and pack existing PDF

Postby 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
lbleicher
 
Posts: 11
Joined: Fri Nov 04, 2011 4:51 am

Re: How to compress and pack existing PDF

Postby 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
Loïc Carrère, support team.
www.orpalis.com
User avatar
Loïc
Site Admin
 
Posts: 4437
Joined: Tue Oct 17, 2006 10:48 pm
Location: France

Re: How to compress and pack existing PDF

Postby 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
lbleicher
 
Posts: 11
Joined: Fri Nov 04, 2011 4:51 am

Re: How to compress and pack existing PDF

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

Loïc Carrère, support team.
www.orpalis.com
User avatar
Loïc
Site Admin
 
Posts: 4437
Joined: Tue Oct 17, 2006 10:48 pm
Location: France


Return to GdPicture PDF Plugin

Who is online

Users browsing this forum: No registered users and 1 guest

cron