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

how does pdfsharp compress images?
https://forum.pdfsharp.net/viewtopic.php?f=2&t=1724
Page 1 of 1

Author:  emilioesteve [ Tue Jul 26, 2011 11:07 am ]
Post subject:  how does pdfsharp compress images?

Hi,

Could anyone tell me what compression is chosen when it creates the pdf? Is there a way to push a compression type or is it done automatically?
I'm creating pdfs with only images, and these images are black & white.

How can I know the compression used in the pdf file?
I have read in the forum that PdfSharp uses LZ, but if I open the pdf file with a text editor I can see after "/Filter" the Flate algorithm.

Regards

Author:  Thomas Hoevel [ Tue Jul 26, 2011 1:58 pm ]
Post subject:  Re: how does pdfsharp compress images?

Hi!

JPEG images are stored as they are.
Bilevel images (monochrome) will be compressed using FAX encoding (CCITT) and/or LZW encoding.
Other images use LZW encoding (called FlateDecode in PDF).

PDFsharp does not analyse your pictures. If you store bilevel images in a 24 bit format, LZW encoding will be used.
If you convert them to a 1 bit format, CCITT encoding will be used if that creates the smallest possible file (but LZW is better for certain bilevel files).

Author:  emilioesteve [ Tue Jul 26, 2011 2:32 pm ]
Post subject:  Re: how does pdfsharp compress images?

Thanks Thomas! That's exactly what I need to know.

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