Ways to add text without bloating file-size? #232
-
Is there any way to add text with PDFSharp that doesn’t bloat the file size?
on every page. Then I wanted to write "short text marker" on the bottom of every page. testdoc-Stirling.pdf I also tested this with older PDFSharp versions, and the current one with GDI instead of Core, no changes. All done in release mode. The relevant code:
I also tried
which didn’t help. Originally I tried this on a more complicated 320 pages 29.7 MB e-book (which I can’t share for copyright reasons), that got bloated to 41.6 MB. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
PDFsharp cannot write object streams, so currently all object streams will be decompressed when opening a PDF file. This can lead to larger PDF files. Running a PDF compressor after changing PDF files with PDFsharp may reduce file size if the optimzer can create object streams and maybe even merge fonts. |
Beta Was this translation helpful? Give feedback.
PDFsharp cannot write object streams, so currently all object streams will be decompressed when opening a PDF file. This can lead to larger PDF files.
Unreferenced objects will be removed. This can lead to smaller PDF files.
When adding new text, new font objects will be added. Fonts will be added once, no matter how many pages you change in one session.
Running a PDF compressor after changing PDF files with PDFsharp may reduce file size if the optimzer can create object streams and maybe even merge fonts.