-
Notifications
You must be signed in to change notification settings - Fork 493
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
coordinates behaves differently for text and graphics in rotated page #463
Comments
Oha! |
As you can see, I have located the error and published a fixe with version 1.16.12. Background of the cause: |
PyPI upload now complete. |
@JorjMcKie, this means "co-ordinates will be from Top Left of un-rotated page", right? With Note the text, circle and rectange at the 20, 20 from top left of the un-rotated page (top-right of the 90 deg rotate page) |
@twnaing - exactly right. My approach of repairing that bug has its limitations of course. And I'm afraid they are inevitable limitations, too. You luckily didn't also complain about inconsistencies, when inserting annotations on a rotated page 😎! They too behave inconsistently in the same way as your text and image examples ... There is a rather dirty circumvention for all of this:
|
So, the summary is
|
Yes, exactly. Let me add:
|
The remaining annoyance is about annotations. I will continue to investigate this ... |
On inserting images around edges, I found that It traced back to utils.py:252 r = page.rect & rect
if r.isEmpty or r.isInfinite:
raise ValueError("rect must be finite and not empty") IMO, on line 250, it should be Currently I use dirty circumvention
|
You are right - thanks for the hint. I will change that one too. Will become effective in a version after 1.16.13. |
Please provide all mandatory information!
Describe the bug (mandatory)
The coordinates behaves differently for Text and Graphics (circle, rectangle) in rotated page.
To Reproduce (mandatory)
Expected behavior (optional)
Screenshots (optional)
before manipulation
after manipulation
please ignore other extra rectangle at the bottom and text in center
Your configuration (mandatory)
Additional context (optional)
The PDF has been checked for this issue
https://pymupdf.readthedocs.io/en/latest/faq/#misplaced-item-insertions-on-pdf-pages
code used
file used
The text was updated successfully, but these errors were encountered: