function DeviceToPage(X, Y, Left, Top, Width, Height: Integer; Rotation: TRotation; out PageX, PageY: Double): Boolean;
| X, Y | Integer. The device-space coordinates of the point to convert (screen pixels, origin at top-left). |
| Left, Top, Width, Height | Integer. The rendering rectangle that was passed to the corresponding RenderPage call. |
| Rotation | TRotation. 렌더링할 때 사용한 page rotation입니다. RenderPage에 전달한 값과 일치해야 합니다 |
| PageX, PageY | Double. Output parameters that receive the converted PDF user-space coordinates (origin at lower-left, units in points). |
True를, 실패하면 False를 반환합니다(예: page가 로드되지 않은 경우)device space(screen pixel)의 point를 PDF user space(point)로 변환합니다. 렌더링된 page의 mouse click 위치를 PDF page에서의 대응 위치로 되돌릴 때 사용하세요
PDF user space의 원점은 page의 왼쪽 아래이며 Y axis는 위로 향합니다. device space의 원점은 render rectangle의 왼쪽 위이며 Y axis는 아래로 향합니다
Left, Top, Width, Height, Rotation parameter는 클릭한 image를 만든 RenderPage 호출에 전달한 값과 정확히 일치해야 합니다
// Translate a mouse click on the painted page to PDF coordinates
procedure TForm1.PdfPanelMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
var
PageX, PageY: Double;
begin
if Pdf.DeviceToPage(X, Y, 0, 0, PdfPanel.Width, PdfPanel.Height,
ro0, PageX, PageY) then
StatusBar1.SimpleText := Format('Page pos: %.1f, %.1f pt', [PageX, PageY]);
end;