-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BUG: page.mediabox not updating correctly when merging #636
Comments
I had the same problem, cropping a pdf changing mediaBox (or TrimBox or cropBox) attributes seems to work fine, saving the cropped page as a new PDF show the cropped image as intended, but merging the cropped pdf (even the one saved on file) keeps adding the original uncropped image. |
Yeah I had to make a edit in pdf.py (pypdf2) to finally get what I wanted. |
Could you make a pr with the fix? Maybe also with a unit test that shows the issue? |
I'm not that into githubs features yet :) But this is what I altered, in the "pdf.py" file in PyPDF2 for it to work with my needs: Add this after line 2280 (indented) (if page1Content is not None:)
|
tracked in py-pdf#636 thee smaller box between cropBox is and trimBox(== mediaBox by default) is used
This is not fixed by the recent release, right? |
Yes It should. as you were at the author can you close it with the reference to the good PR ? (I'm delegating now 😁) |
I am sorry but I do not understand what you are referring to with "as you were at the author". Unfortunately, I was not able to merge a cropped pdf in the desired way. I upgraded to Release 3.4.1, where it is using the I am happy to prepare an example if desired. |
this is closed by #1567 |
I cropped a 2 page business card PDF file so most of the bleed and cropmarks where cut of.
I wanted my card to have a Trim Size of 85 x 55 mm and have a bleed of 2.5 mm.
Doing so - when I place 2 cards right next to each other, I have a 5 mm gap. This is what I want.
The cropping looked like It was doing ok, I opened the cropped pdf and it looked fine.
BUT when I try placing this cropped pdf, suddenly its placing the pages like it was never cropped!
Its placing the full original mediaBox size. Theres a bug in there somehow...
I even tried placing the cropped pdf in indesign and "brew" a new identical pdf, to se if it was a bug in the file.
The indesign pdf imported correctly showing the file as intended.
The text was updated successfully, but these errors were encountered: