PDFium Delphi Component Docs

CharacterRectangle プロパティ

コンポーネント: TPdf  ·  ユニット: PDFium
PDF user-space coordinate で表した character の bounding rectangle を返す read-only indexed access です (原点は左下、単位は point)

Syntax

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

Description

文字の bounding rectangle を PDF user-space 座標(原点左下、point 単位)で取得するインデックス付き read-only アクセスです。現在のページでは 0 .. CharacterCount - 1 が有効範囲で、範囲外のインデックスは EPdfError を発生させます

文字は論理的な読み順(PDFium が content stream を解析した順)で返されます。視覚順とは限らず、右から左に書く言語では逆順に見えることがあります

座標はすべて PDF user-space のポイント単位で、原点はページ左下です。VCL キャンバスへ重ね描きするときは PdfView1.PointsToScreen か独自の座標変換を使ってください

Parameters

CharIndex現在のページでの 0 基準の文字インデックス(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