Closed Dotrar closed 1 year ago
You should use the correct RTD page, which seems to use the correct code: https://pypdf.readthedocs.io/en/latest/user/file-size.html#lossless-compression
Thanks for the clarification. quite a mix-up with the two projects.
@Dotrar I agree that the read the docs (RTD) generated docs of PyPDF2 are confusing as they are still linked in a lot of places + look very similar to pypdf. I've opened https://github.com/py-pdf/pypdf/issues/2051 to fix that.
@MartinThoma thanks for that.
Regarding our issue at hand, we've found a massive increase in filesizes when joining multiple pdf's together after we've updated from the old pypdf2 PdfMerger
to the newer pypdf PdfWriter
- using the same example code on the docs.
Is there some documentation changes or something obvious we're missing or should i just make a new ticket?
ATM, the solution for us is to revert back and use to the older pyPDF2 ( ._.)
Can you tell me more about which merge / append methods you're using?
Do you add watermarks/stamps?
@Dotrar You should use append() and not add_page(). Some issues used to be reported. You should also search within the closed threads
Reading this page, it suggests doing the following:
However, this can't work, as there is a specific exception ensuring that page is from
PdfWriter
is being used (code sample is using page fromPdfReader
).We found this as we've recently updated from
~2.8.X
-->3.0.X
and now our 600kb files from the deprecatedPdfMerger
are now 10mb (!) files by usingPdfWriter
, so we desperately need to reduce file sizes, if you have any more tips about that :)