PDFium Delphi Component Docs

PageToDevice method

Component: TPdfView  ·  Unit: PDFium
Inverse of DeviceToPage: converts a PDF user-space point to a screen pixel inside the view

Syntax

function PageToDevice(PageX, PageY: Double; out X, Y: Integer): Boolean; overload;

 

function PageToDevice(Rectangle: TPdfRectangle): TRect; overload;

Description

Inverse of DeviceToPage: converts a PDF user-space point to a screen pixel inside the view

Use this to position a VCL TLabel or TShape over a specific PDF coordinate

TPdfView maintains the device-to-page transform internally based on Zoom, Rotation, page padding, and scroll offset; these helpers are the safe public interface to that transform

Remarks

Example

procedure TForm1.ShowPagePoint;
var
  DeviceX, DeviceY: Integer;
begin
  if PdfView1.PageToDevice(72.0, 72.0, DeviceX, DeviceY) then
    Caption := Format('px = (%d, %d)', [DeviceX, DeviceY]);
end;

See Also

DeviceToPage

Partially clipped parent containers restrict visible tiles without recentering the page or spread; painting, reading cursors and page/device conversion retain the full viewer client origin