PDFiumVCL 文档

PixelsToPoints method

此 API 条目保留标识符、签名、代码块和 PDF 术语的原始形式。
Component: TPdf  ·  Unit: PDFium
Convert a pixel measurement at the given DPI to PDF points (1/72 inch).

Syntax

class function PixelsToPoints(Pixels: Integer; DPI: Integer = 96): Double;

Description

Static helper that converts a measurement value 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.

These helpers are class functions; you can call them without instantiating TPdf (e.g. TPdf.PixelsToPoints(96)).

Remarks

Example

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

See Also

PixelsToInches, PointsToInches, PointsToPixels