PDFium Delphi Component Docs

TransformPageObject メソッド

コンポーネント: TPdf  ·  ユニット: PDFium
1 つのページオブジェクトの変換マトリックスを掛け、その場で移動、拡大、回転、せん断します

構文

procedure TransformPageObject(Index: Integer; const Matrix: FS_MATRIX);

IndexInteger. Zero-based index of the page object to transform.
MatrixFS_MATRIX. Transform to apply, with fields a, b, c, d, e, f in PDF matrix order. Translation lives in e and f, expressed in points.

説明

オブジェクトの既存マトリックスに Matrix を置き換えずに連結するため、繰り返し呼び出すと累積します。代わりに絶対マトリックスを設定するには、PageObjectInfoMatrix フィールドを pocMatrixUpdatePageObject に書き戻します

単位マトリックスは (1, 0, 0, 1, 0, 0) です。dxdy ポイントの平行移動は (1, 0, 0, 1, dx, dy)sxsy の拡大は (sx, 0, 0, sy, 0, 0)、角度による回転は abcd にコサインとサインを使います

動くのは 1 つのオブジェクトだけです。注釈を含むページ全体を変換するには TransformPageContentTransformPageAnnotations を使います

var M: FS_MATRIX;
M.a := 1; M.b := 0; M.c := 0; M.d := 1;
M.e := 72; M.f := 0; // shift one inch to the right
Pdf.TransformPageObject(0, M);
Pdf.UpdatePage;

関連項目

UpdatePageObject, TransformPageContent, TransformPageAnnotations, PageObjectInfo