shape different between getText and getPixmap #1143
-
First, I used getText(option='dict') to get a dict. This dict includes width and height and some text information of the page. My purpose is to match information from dict to image. I want to know how can I match the width and height from image to dict, it seems it should rotate 90 degrees cw or ccw, but I don`t know how to decide it. Thank you, Jorj. code: pm = page.getPixmap() |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
There is an important difference, how page rotation is handled by functions dealing with coordinates of page elements and functions rendering the page to a pixmap:
So to synchronize, you need to either rotate the pixmap ( |
Beta Was this translation helpful? Give feedback.
-
This is caused by the fact, that an image must have integer width and height, whereas the page itself has float dimensions. |
Beta Was this translation helpful? Give feedback.
There is an important difference, how page rotation is handled by functions dealing with coordinates of page elements and functions rendering the page to a pixmap:
So to synchronize, you need to either rotate the pixmap (
prerotate()
method) or (temporarily) de-rotate the page before rendering.You could of course also compute the rotated coordinates of anything provided by tex…