ConvertFromPoints
Measurement and coordinate units
Description
Converts a length expressed in points into the equivalent value in the given measurement unit and returns it. The conversion applies the scale in which 72 points make one inch.
Syntax
Delphi
Function TPDFlib.ConvertFromPoints(AUnit: TPDFlibMeasurementUnit; Value: Double): Double;
Parameters
AUnit gives the unit the result is expressed in: muPixels and muPoints both map one-to-one onto points, muMillimeters applies a factor of 72/25.4, muInches applies 72 and muTwips applies 1/20. Value is the length in points that is to be converted; any finite Double is accepted, zero and negative values included.
Return values
The equivalent length in AUnit, obtained by dividing Value by the unit's points-per-unit factor. The function is pure arithmetic with no failure path, so every result is a genuine conversion and a result of 0 only means that Value was 0; no document needs 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 pass through at full Double precision without rounding; use ConvertToPoints for the opposite direction.