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

How to specify PdfWriterLayout ?
https://forum.pdfsharp.net/viewtopic.php?f=2&t=3726
Page 1 of 1

Author:  Chris87 [ Tue Feb 06, 2018 12:01 pm ]
Post subject:  How to specify PdfWriterLayout ?

Hi all,

Making good progress using PDFSharp, but the file output is very very large. For example I can make a minor edit to an existing ~200kb PDF and it will be re-written around 500kb!

I see there's a PdfWriterLayout enum which PdfWriter uses, and it appears that in all but DEBUG builds it uses Compact - however I see no change in behaviour between debug or release builds?

Is there an API to set it manually? Does the NuGet package include Release & Debug builds?

Ideas?

Thanks

Author:  Thomas Hoevel [ Tue Feb 06, 2018 1:03 pm ]
Post subject:  Re: How to specify PdfWriterLayout ?

Hi!
Chris87 wrote:
Does the NuGet package include Release & Debug builds?
The NuGet packages contain the Release build and write PDF files without comments. The Debug build creates larger files with comments to make the PDF somewhat human-readable for debugging purposes.

Author:  Chris87 [ Tue Feb 06, 2018 2:47 pm ]
Post subject:  Re: How to specify PdfWriterLayout ?

Thomas Hoevel wrote:
Hi!
Chris87 wrote:
Does the NuGet package include Release & Debug builds?
The NuGet packages contain the Release build and write PDF files without comments. The Debug build creates larger files with comments to make the PDF somewhat human-readable for debugging purposes.


Thanks for the prompt reply :). Are there any settings of save options I can use to try and decrease the file size?

For reference I'm starting with a 163kB PDF, editing 3 metadata streams (maybe adding a dozen characters overall) and then saving the document, the resulting file is 621kB.

From checking manually it would appear that some fields are being recreated many times over, leading to it's large size. Some annotations and forms are duplicated 4 times over?

Any ideas? I feel like I'm just missing something simple here.

Author:  Chris87 [ Tue Feb 06, 2018 3:24 pm ]
Post subject:  Re: How to specify PdfWriterLayout ?

Apologies I was being a complete buffoon! Turns out i was myself 'saving' the file many times before closing the stream, so they were concatenated. Oops.

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