PDFium Component Docs

PageToDevice Yöntem

Bu API girdisi tanımlayıcıları, imzaları, kod bloklarını ve PDF terimlerini özgün biçiminde korur.
Bileşen: TPdf  ·  Birim: PDFium
Convert the page coordinate of a point to screen coordinate.

Söz dizimi

function PageToDevice(PageX, PageY: Double; Left, Top, Width, Height: Integer; Rotation: TRotation; out X, Y: Integer): Boolean;

PageX, PageYDouble. The PDF user-space coordinates to convert (origin at lower-left, units in points).
Left, Top, Width, HeightInteger. The rendering rectangle that was passed to the corresponding RenderPage call.
RotationTRotation. İşleme sırasında kullanılan sayfa döndürmesi. Şuna geçirilen değerle eşleşmelidir RenderPage.
X, YInteger. Output parameters that receive the converted device-space pixel coordinates (origin at top-left).

Return Value

Döndürür: True if the conversion succeeded, or False if it failed (for example, if no page is loaded).

Açıklama

PDF user space içindeki bir noktayı device space’e (ekran pikseli) dönüştürür. Bu yöntemi, bilinen bir PDF koordinat konumunun render edilen görüntüde nereye düştüğünü belirlemek için kullanın — örneğin bir annotation overlay ya da highlight rectangle yerleştirmek için

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, Üst, Width, Height, and Rotation parameters must match exactly what was passed to the RenderPage call that produced the image being mapped onto.

Örnek

// 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;

Ayrıca bkz.

DeviceToPage, RenderPage, PageWidth, PageHeight