Link to home
Start Free TrialLog in
Avatar of VBdotnet2005
VBdotnet2005Flag for United States of America

asked on

compress pdf

Is there a .net object to compress pdf file?
ASKER CERTIFIED SOLUTION
Avatar of Jacques Bourgeois (James Burger)
Jacques Bourgeois (James Burger)
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I never saw a significant gain when I tested pdf compressions. But if MlandaT says so...

.NET has 2 classes that can be used for file compression: GZipStream and DeflateStream. Look for those in the documentation. The sample code given for DeflateStream shows how easy it is to use.
@James... for the most part you are in fact quite right. Most PDFs are already well compressed there is often no noticeable file size reduction. However, I have seen some cases where we generate PDF exports on some systems and the PDFs are quite big, but once say you open the PDF and save it in Acrobat Processional, there is a noticeable reduction in file size. That said, I'm not sure an implementation based on GZipStream and DeflateStream will compress the PDF internally (well... easily)... Those are fine is the intent is to send out the resulting file just as a ZIP file or something.

We've experimented with MultiValent (Java) on a bulk PDF reports distribution platform for a billing company. I must say, we noticed a 10-15% size reduction but we just thought the extra processing didnt really add much benefit to our cause. Due to other considerations, we eventually ported the app to C# and used Crystal Reports (with PDF exports) and I dont see that much of a problem with the PDF file size.
Avatar of VBdotnet2005

ASKER

We said everyone. Thank you so much.