PDFiumVCL Docs

PageToDevice method

この API エントリでは識別子、シグネチャ、コードブロック、PDF 用語を元の表記のまま保持します。
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

Description

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

Use 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.PdfView1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
var
  PageX, PageY: Double;
begin
  if PdfView1.PageToDevice(X, Y, PageX, PageY) then
    Caption := Format('pt = (%.2f, %.2f)', [PageX, PageY]);
end;

See Also

DeviceToPage