PDFsharp & MigraDoc Foundation
https://forum.pdfsharp.net/

Need to know a way to compress the PDF
https://forum.pdfsharp.net/viewtopic.php?f=2&t=1019
Page 1 of 1

Author:  mafaisal [ Tue Jan 12, 2010 5:10 am ]
Post subject:  Need to know a way to compress the PDF

Hi,

Thanks for this good software. I like to know some ways to improve my PDF quality with this tool. My PDF contains image and text. As far I know, PDFSharp uses LZW compressed bitmap format for PDF compression. My application produces good quality PDF with larger size with this tool. But my user needs to use them in web. For this, I like to reduce the size of the PDF. So, if you guide me it would be nice. Thanks in advance.

Author:  Thomas Hoevel [ Tue Jan 12, 2010 9:05 am ]
Post subject:  Re: Need to know a way to compress the PDF

Hi!

PDFsharp neither changes the resolution of an image nor does it re-compress JPEG files.

Examples: if you have a picture size 500x500 pixel and you think 250x250 pixel are enough for web, then it's up to you to resize the image. This will eliminate 75 % of the pixel and may save a similar amount of file size.

JPEG allows compression with different quality settings. Using a lower quality for web will also reduce file size.
You should use an image with lossless compression to start from (if possible). Better not re-compress JPEG files, but start with the original file (BMP, TIFF, PNG, ...).

Author:  mafaisal [ Wed Jan 13, 2010 4:14 am ]
Post subject:  Re: Need to know a way to compress the PDF

Thanks for your reply. Okay, is there a way to compress a PDF with PDFsharp API? Actually, in my application the image arrive as a web response and then I cast it as image. However, It would be nice if there is a way through PDFSharp API to save PdfDocument in a compressed way, that is, to compress the complete PdfDocument before saving in PDFSharp. I think I could make you understand my problem. Thanks in advance.

Author:  Thomas Hoevel [ Wed Jan 13, 2010 9:56 am ]
Post subject:  Re: Need to know a way to compress the PDF

Such a feature is on the wish list, but not on the roadmap.
This won't be implemented in the near future.

Before passing the image to PDFsharp, use something like StretchBlt to create a smaller version of it.

Author:  mafaisal [ Fri Jan 15, 2010 5:15 am ]
Post subject:  Re: Need to know a way to compress the PDF

Thanks for your reply and provided information. We hope the wish will be done in near future.

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/