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

PDF size reduction
https://forum.pdfsharp.net/viewtopic.php?f=2&t=1787
Page 1 of 1

Author:  Mjt [ Thu Sep 15, 2011 1:09 pm ]
Post subject:  PDF size reduction

Hi all,

We are in a situation where we need to reduce the size of our generated PDF's as much as possible. This means: low dpi (300 or less), no embedded fonts, compression where possible, etc.

Is it possible to tell PDFSharp what DPI to use when creating PDF's, and to exclude fonts? If yes, can you tell us how?

Thanks in advance!

Author:  Thomas Hoevel [ Thu Sep 15, 2011 1:23 pm ]
Post subject:  Re: PDF size reduction

Hi!

Images are stored as they come. Reduce the size of the images to save bytes here; for JPEG images, save them with reduced quality to reduce the file size without changing image resolution.
If images contain only two colors, save them as bitonal (this allows PDFsharp to use the smallest possible image format).

Fonts are not embedded if you specify that:
Code:
XPdfFontOptions options = new XPdfFontOptions(PdfFontEncoding.WinAnsi, PdfFontEmbedding.None);


PDF files created with the DEBUG build are "verbose", so use a RELEASE build to see the real file sizes. All supported compression is on by default.

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