-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Reusing PdfMerger after write generates PDF with extra pages #1337
Copy link
Copy link
Closed
Labels
help wantedWe appreciate help everywhere - this one might be an easy start!We appreciate help everywhere - this one might be an easy start!is-bugFrom a users perspective, this is a bug - a violation of the expected behavior with a compliant PDFFrom a users perspective, this is a bug - a violation of the expected behavior with a compliant PDFworkflow-mergeFrom a users perspective, merging is the affected feature/workflowFrom a users perspective, merging is the affected feature/workflow
Metadata
Metadata
Assignees
Labels
help wantedWe appreciate help everywhere - this one might be an easy start!We appreciate help everywhere - this one might be an easy start!is-bugFrom a users perspective, this is a bug - a violation of the expected behavior with a compliant PDFFrom a users perspective, this is a bug - a violation of the expected behavior with a compliant PDFworkflow-mergeFrom a users perspective, merging is the affected feature/workflowFrom a users perspective, merging is the affected feature/workflow
I was trying to merge the same PDF with itself multiple number of times. 1st I want to have the original PDF, then I want to have the PDF duplicated, then I want to duplicate it three times, and so forth.
Environment
ubuntu 20.04
Python==3.8.12+
Package Version
pip==21.1.1
PyPDF2==2.10.5
setuptools==56.0.0
typing-extensions==4.3.0
$ python -m platform Linux-5.11.0-40-generic-x86_64-with-glibc2.29 $ python -c "import PyPDF2;print(PyPDF2.__version__)" 2.10.5Code + PDF
This is a minimal, complete example that shows the issue:
Here is the blank.pdf that causes the issue.
Expected behavior
1.pdf: must contain 1 page but contains 1 page ✅
2.pdf: must contain 2 page but contains 2 page ❌
3.pdf: must contain 3 page but contains 3 page ❌
4.pdf: must contain 4 page but contains 4 page ❌
5.pdf: must contain 5 page but contains 5 page ❌
6.pdf: must contain 6 page but contains 6 page ❌