-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Labels
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 PDF
Description
I have PDF containing a grid, which I merge with a blank page. (The PDF was exported from PowerPoint.) However, the lines in the grid do not get faithfully reproduced. Instead, the lines get shifted over and down. See the following screenshot, with the original at 25% opacity and the output at 100% opacity:
Environment
Which environment were you using when you encountered the problem?
$ python -m platform
macOS-12.5.1-arm64-arm-64bit
$ python -c "import PyPDF2;print(PyPDF2.__version__)"
2.10.3Code + PDF
This is a minimal, complete example that shows the issue:
from PyPDF2 import PdfReader, PdfWriter, PageObject
reader = PdfReader('./grid.pdf')
writer = PdfWriter()
page = reader.pages[0]
mediabox = page.mediabox
blank_page = PageObject.create_blank_page(None, mediabox.width, mediabox.height)
page.merge_page(blank_page)
page.mediabox = mediabox
writer.add_page(page)
writer.add_metadata(reader.metadata)
with open('./grid-output.pdf', 'wb') as outfile:
writer.write(outfile)Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
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 PDF
