Skip to content

BUG: When scaling a page, reset the cropBox to match the new mediaBox#272

Closed
BrianPainter wants to merge 3 commits intopy-pdf:mainfrom
BrianPainter:master
Closed

BUG: When scaling a page, reset the cropBox to match the new mediaBox#272
BrianPainter wants to merge 3 commits intopy-pdf:mainfrom
BrianPainter:master

Conversation

@BrianPainter
Copy link
Copy Markdown
Contributor

When a page is scaled, shouldn't the cropBox scale at the same rate as the mediaBox? If the cropBox is not changed, then we end up with a "zoomed in" view of the PDF page (if we were scaling to a larger size).

@ggicci
Copy link
Copy Markdown

ggicci commented Mar 3, 2021

The cropBox and mediaBox can be different. I guess you are trying to scale the cropBox by the same factor the mediaBox has scaled?

@MartinThoma MartinThoma added the Tiny Pull requests that make a tiny change - and thus should be easy to merge label Apr 6, 2022
@MartinThoma
Copy link
Copy Markdown
Member

Thank you for the contribution :-)

@MartinThoma
Copy link
Copy Markdown
Member

Reminds me of #240 😄

@MartinThoma MartinThoma added the needs-discussion The PR/issue needs more discussion before we can continue label Apr 16, 2022
@MartinThoma
Copy link
Copy Markdown
Member

I'm uncertain if this is actually desirable. A unit test which shows the new behavior would be amazing 🙏

@MartinThoma MartinThoma changed the title when scaling a page, reset the cropBox to match the new mediaBox BUG: When scaling a page, reset the cropBox to match the new mediaBox Jun 25, 2022
@MartinThoma MartinThoma added the needs-rebase This PR cannot be merged as the main branch is too different. You need to rebase or merge main. label Jun 26, 2022
@MartinThoma MartinThoma added the is-bug From a users perspective, this is a bug - a violation of the expected behavior with a compliant PDF label Jul 6, 2022
MartinThoma added a commit that referenced this pull request Jul 6, 2022
@MartinThoma
Copy link
Copy Markdown
Member

@BrianPainter @ggicci I've moved the logic to #1066 as PyPDF2 has changed a lot and rebasing would likely be a pain. I would appreciate if you would participate in the discussions there :-)

Especially, I would like to know what you think about scaling all of the other boxes as well.

@MartinThoma MartinThoma closed this Jul 6, 2022
MartinThoma added a commit that referenced this pull request Jul 6, 2022
Co-authored-by: Henri Salo <henri.salo@nixu.com>

Closes #272
MartinThoma added a commit that referenced this pull request Jul 6, 2022
Closes #272

Co-authored-by: Henri Salo <henri.salo@nixu.com>
MartinThoma added a commit that referenced this pull request Jul 6, 2022
Closes #272

Co-authored-by: Brian Painter <brianpainter@tindallcorp.com>
MartinThoma added a commit that referenced this pull request Jul 9, 2022
Closes #272

Co-authored-by: Brian Painter <brianpainter@tindallcorp.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

is-bug From a users perspective, this is a bug - a violation of the expected behavior with a compliant PDF needs-discussion The PR/issue needs more discussion before we can continue needs-rebase This PR cannot be merged as the main branch is too different. You need to rebase or merge main. Tiny Pull requests that make a tiny change - and thus should be easy to merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants