function PageToDevice(PageX, PageY: Double; Left, Top, Width, Height: Integer; Rotation: TRotation; out X, Y: Integer): Boolean;
| PageX, PageY | Double. 변환할 PDF user-space coordinates입니다(원점은 왼쪽 아래, 단위는 points) |
| Left, Top, Width, Height | Integer. 해당 RenderPage call에 전달된 rendering rectangle입니다 |
| Rotation | TRotation. 렌더링할 때 사용한 page rotation입니다. RenderPage에 전달한 값과 같아야 합니다 |
| X, Y | Integer. 변환된 device-space pixel coordinates를 받는 output parameter입니다(원점은 왼쪽 위) |
True, 실패하면 False를 반환합니다(예: page가 로드되지 않은 경우)point를 PDF user space(points)에서 device space(screen pixels)로 변환합니다. 이 method를 사용하면 알고 있는 PDF-coordinate 위치가 렌더된 image의 어디에 놓이는지 알 수 있습니다 — 예를 들어 annotation overlay나 highlight rectangle을 배치할 때 유용합니다
PDF user space has its origin at the lower-left corner of the page, with the Y axis pointing upward. Device space has its origin at the top-left corner of the render rectangle, with the Y axis pointing downward.
The Left, 맨 위, Width, Height, and Rotation parameters must match exactly what was passed to the RenderPage call that produced the image being mapped onto.
// Draw a marker on screen at a known PDF position
var
ScreenX, ScreenY: Integer;
begin
if Pdf.PageToDevice(100.0, 200.0, 0, 0,
PdfPanel.Width, PdfPanel.Height, ro0, ScreenX, ScreenY) then
begin
Canvas.Pen.Color := clRed;
Canvas.Ellipse(ScreenX - 4, ScreenY - 4, ScreenX + 4, ScreenY + 4);
end;
end;