PDFsharp & MigraDoc Foundation
http://forum.pdfsharp.com/

Compress .pdf by unembedding fonts
http://forum.pdfsharp.com/viewtopic.php?f=2&t=4354
Page 1 of 1

Author:  ju bo [ Thu Jul 14, 2022 1:39 pm ]
Post subject:  Compress .pdf by unembedding fonts

Hello!

Could you please help me with setting proper options to shrink document size?

I am trying to reduce file size of .pdf reports that are downloaded from SSRS, then sent to network printers and their copies are stored on a server.

The problem is, when the files are downloaded from SSRS without fonts embedded, they have small size but some HP printers fail to print them.
Installing needed fonts to those printers currently is inappropriate solution, unfortunately.

My intention is to download files in a standard .pdf (containing fonts) format and send them as they are to printers, and then reduce the file sizes using PdfSharp for saving them to a disk. The files are copied and in some cases combined, so new PdfDocuments are created, after that page copies of initial docs are added to them.

I tried methods like the following:
Code:
document.Options.FlateEncodeMode = PdfFlateEncodeMode.BestCompression;
document.Options.NoCompression = false;
document.Options.CompressContentStreams = true;

These options were applied to an empty document before pages were copied to it, but it didn't help. The documents contain text and tables only (no images that could be compressed).

Could you please advise on what approach should be chosen to shrink those files (in ideal world, how to unembed fonts, but maybe I should look for another methods)?

Sorry if my message is too complicated.
Thanks in advance.

Author:  TH-Soft [ Thu Jul 14, 2022 8:04 pm ]
Post subject:  Re: Compress .pdf by unembedding fonts

Hi!

PDFsharp cannot unembed fonts. PDFsharp does not merge embedded fonts when combining documents.

Author:  ju bo [ Fri Jul 15, 2022 8:05 am ]
Post subject:  Re: Compress .pdf by unembedding fonts

OK, clear.

Thanks for your answer!
And does PdfSharp allow embed fonts in an existing document?

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