PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Tue Mar 19, 2024 6:28 am

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Tue Feb 06, 2018 12:01 pm 
Offline

Joined: Tue Feb 06, 2018 11:35 am
Posts: 3
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


Top
 Profile  
Reply with quote  
PostPosted: Tue Feb 06, 2018 1:03 pm 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3092
Location: Cologne, Germany
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.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Tue Feb 06, 2018 2:47 pm 
Offline

Joined: Tue Feb 06, 2018 11:35 am
Posts: 3
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.


Top
 Profile  
Reply with quote  
PostPosted: Tue Feb 06, 2018 3:24 pm 
Offline

Joined: Tue Feb 06, 2018 11:35 am
Posts: 3
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.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: Bing [Bot] and 44 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group