-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Description
I need to read in a fillable form pdf, fill it out, then generate result pdf. this is largely working, except that page 2 of the pdf (which contains only text) doesn't get properly appended. It's text contents are laid over the top of a copy of page 1.
Environment
Which environment were you using when you encountered the problem?
$ python -m platform
macOS-11.6.5-x86_64-i386-64bit
$ python -c "import pypdf;print(pypdf.__version__)"
3.3.0Code + PDF
This is a minimal, complete example that shows the issue:
from pypdf import PdfReader, PdfWriter
reader = PdfReader('cms1500.pdf')
writer = PdfWriter()
writer.append(reader)
with open('copy.pdf', "wb") as output_stream:
writer.write(output_stream)Pdf source is
form-cms1500.pdf - a standard pdf in healthcare. There should be no problem with you using it in test suites.
Results
Outcome from using writer.append:

Outcome from using writer.append(reader, [1])

NOTE: Outcome from using writer.clone_document_from_reader does produce expected output BUT i can't use it as it causes other problems (namely after clone writer.pages items appear to be DictionaryObject and not PageObject):
