Document Library Coordinate System

The LEADDocument class uses coordinates in 1/720 of an inch. This is the same unit of measure used by the LEADTOOLS Annotations library. This value is stored in the constant UnitsPerInch and is set to 720.

This unit of measure is used because it is device-independent and uniform regardless of the current screen or device resolution (DPI).

A resolution in dots per inch (DPI) is needed to convert from document coordinates to pixels and vice versa. This is done using the following formula:

Pixels = (Document Units / 720) * Resolution

The DocumentToPixels method uses this formula to convert from document units to pixels.

The following formula is used to convert from pixels to document coordinates:

Document Units = (Pixels / Resolution) * 720

The PixelsToDocument method uses this formula to convert from pixels to document units.

When loading documents, each page size is stored in the Size property in document units. Although rare, some document formats such as TIFF and PDF support having different size pages and thus, the size is stored in the page object itself and not in the document.

The global document resolution is parsed by the loader and set in the DocumentPages.DefaultResolution value. Again, each page may have different resolutions depending on the document format and hence, DocumentPage.Resolution will contain the actual resolution of the page (in most cases, equal to DocumentPages.DefaultResolution.

Most of the coordinates use values of LeadPointD, LeadSizeD and LeadRectD that represent a point, a size, and a rectangular area. The LEADDocument class contains the following helper methods to quickly convert any of these values from document to pixel coordinates and vice versa: LEADDocument.PointToPixels, LEADDocument.PointToDocument, LEADDocument.SizeToPixels, LEADDocument.SizeToDocument, LEADDocument.RectToPixels and LEADDocument.RectToDocument.

See Also

Document Library Features

Loading Using LEADTOOLS Document Library

Creating Documents with LEADTOOLS Document Library

Document Toolkit and Caching

Uploading Using the Document Library

Loading Encrypted Files Using the Document Library

Parsing Text with the Document Library

Barcode Processing with the Document Library

Document Toolkit History Tracking

Document Page Transformation

Using LEADTOOLS Document Viewer

Using LEADTOOLS Document Converter

Document View and Convert Redaction

Help Version 21.0.2021.11.1
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Imaging, Medical, and Document
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.