ConvertFromPoints

Measurement and coordinate units

Description

Converts a length expressed in points to the equivalent value in the given measurement unit and returns it, applying the scale where 72 points equal one inch.

Syntax

Delphi

Function TPDFlib.ConvertFromPoints(AUnit: TPDFlibMeasurementUnit; Value: Double): Double;

Parameters

AUnit is the unit the result is expressed in: muPixels and muPoints both map one-to-one to points, muMillimeters uses a factor of 72/25.4, muInches uses 72 and muTwips uses 1/20. Value is the length in points to convert; any finite Double is accepted, including zero and negative values.

Return values

The equivalent length in AUnit, computed as Value divided by the unit's points-per-unit factor. The function is pure arithmetic and has no failure path, so every result is a real conversion and a result of 0 only means that Value was 0; no document has to be open and no state is read.

Remarks

The factor is fixed and independent of the measurement unit currently set with SetMeasurementUnit, so the call is valid before a document is loaded and does not disturb the unit used for drawing. One inch is 72 points, 25.4 millimetres or 1440 twips. muPixels is deliberately identical to muPoints, which assumes 72 pixels per inch. Values are passed through at full Double precision without rounding; use ConvertToPoints for the opposite direction.