Name
pdf.PageToDevice -- convert page coordinates to screen coordinates (V1.2)
Synopsis
x, y = pdf.PageToDevice(id, page, startx, starty, sizex, sizey, rotate,
           pagex, pagey)
Function
This function can be used to convert the page coordinates of the point specified by pagex and pagey to screen coordinates.

The rotate argument can be used to specify the page orientation. This can be set to the following special values:

0:
Normal.
1:
Rotated 90 degrees clockwise.
2:
Rotated 180 degrees.
3:
Rotated 90 degrees counter-clockwise.

The page to use must be specified in the page argument. It must be a number in the range of 1 to the total number of pages in the document and the page must have been previously loaded using pdf.LoadPage(). The PDF document specified by id must have been previously opened using pdf.OpenDocument().

The page coordinate system has its origin at the left-bottom corner of the page, with the X-axis on the bottom going to the right, and the Y-axis on the left side going up. Note that this coordinate system can be altered when you zoom, scroll, or rotate a page, however, a point on the page should always have the same coordinate values in the page coordinate system.

The device coordinate system is device dependent. For screen devices, its origin is at the left-top corner of the window.

Inputs
id
identifier of the PDF document to use
page
page number to use (starting from 1)
startx
left pixel position of the display area in device coordinates
starty
top pixel position of the display area in device coordinates
sizex
horizontal size (in pixels) for displaying the page
sizey
vertical size (in pixels) for displaying the page
rotate
page orientation (see above for possible values)
pagex
x value in page coordinates
pagey
y value in page coordinates
Results
x
x value in device coordinates
y
y value in device coordinates

Show TOC