Coordinate Systems in PDF Viewer for WinForms
- 2 minutes to read
The PDF Viewer uses the following coordinate systems:
Client Coordinate System
The PDF Viewer control uses the client coordinates (measured in pixels) to specify the points’ position. This coordinate system’s starting point is at the top-left corner of the PDF Viewer’s client area. Refer to the Windows Forms Coordinates article for more details.
Note
The PDF Viewer uses the DPI value equal to 110
when rendering a document (similar to Adobe Reader). Use this value in coordinate conversions.
Page Coordinate System
The page coordinate system’s starting point (0,0) is the left-bottom corner of a page. The Y axis is directed from the bottom of the page to the top.
The page coordinate system uses points (1/72 of an inch) as a measurement unit.
Use Coordinate Systems in API
The table below lists methods that work with client and page coordinates, and methods used to covert one coordinate type into another.
Use Client Coordinates | Use Page Coordinates | Convert Coordinates |
---|---|---|
Convert page coordinates into client coordinates to draw custom graphics on the Control.Paint event in the PDF Viewer. Refer to the How to: Custom Draw in the PDF Viewer article for a code example.
Convert client coordinates to page coordinates when you need to determine what page was clicked in a document. Refer to the How to: Determine the Page Number of a Clicked PDF Page example for more information.
The dpi
variable is a default resolution value for a PDF Viewer.