PDFium Delphi Component Docs

CharacterRectangle property

Component: TPdf  ·  Unit: PDFium
Read-only indexed access to the bounding rectangle of the character in PDF user-space coordinates (origin bottom-left, in points)

Syntax

property CharacterRectangle[Index: Integer]: TPdfRectangle; // read only

Description

Indexed read-only access to the bounding rectangle of the character in PDF user-space coordinates (origin bottom-left, in points). The valid range is 0 .. CharacterCount - 1 for the current page; passing an out-of-range index raises EPdfError

Characters are returned in their logical reading order — the order in which PDFium parsed the content stream — not necessarily the visual order (right-to-left scripts may appear reversed)

All coordinates are PDF user-space points with the origin at the bottom-left. Use PdfView1.PageToDevice or your own coordinate transform when overlaying on a VCL canvas

Parameters

IndexZero-based character index in the current page (0 .. CharacterCount - 1)

Remarks

Example

var
  I: Integer;
begin
  for I := 0 to Pdf1.CharacterCount - 1 do
    R := Pdf1.CharacterRectangle[I]; Canvas.TextOut(Round(R.Left), Round(R.Top), Pdf1.Character[I]);
end;

See Also

CharacterCount, Charcode, Character, TextPage