PDFium Delphi Component Docs

PixelsToPoints function

Unit: PDFium
Convert a pixel measurement at the given DPI to PDF points (1/72 inch)

Syntax

function PixelsToPoints(Pixels, PixelsPerInch: Double): Double;

Description

Static helper converting a measurement between pixel / point / inch units. PDF coordinates are expressed in points (1 pt = 1/72 inch)

Convert a pixel measurement at the given DPI to PDF points (1/72 inch). The conversion formula is value * 72 / DPI

Unit-level helper functions in the PDFium unit; callable without instantiating TPdf (e.g. PixelsToPoints(96, 96))

Remarks

Example

var
  Margin: Double;
begin
  Margin := PixelsToPoints(300, 96);
  Memo1.Lines.Add(Format('PixelsToPoints(300, 96) = %.4f', [Margin]));
end;

See Also

PixelsToInches, PointsToInches, PointsToPixels