PDFiumPas 文件

TransformPageObject 方法

元件: TPdf  ·  單元: PDFium
將單一頁面物件的變換矩陣相乘,就地移動、縮放、旋轉或傾斜它

Syntax

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

IndexInteger. 要變換之頁面物件以零為基底的索引
MatrixFS_MATRIX. 要套用的變換,欄位 abcdef 遵循 PDF 矩陣順序。平移量位於 ef,以點為單位

Description

是將 Matrix 串接到物件既有的矩陣上,而不是取代它,因此重複呼叫會累積。若要改設定絕對矩陣,請透過 UpdatePageObjectpocMatrixPageObjectInfoMatrix 欄位寫回

單位矩陣為 (1, 0, 0, 1, 0, 0)。平移 dxdy 點是 (1, 0, 0, 1, dx, dy);以 sxsy 縮放是 (sx, 0, 0, sy, 0, 0);旋轉某個角度則在 abcd 使用餘弦與正弦

只有該物件會移動。若要連同標註在內變換整個頁面,請使用 TransformPageContentTransformPageAnnotations

Example

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;

See Also

UpdatePageObject, TransformPageContent, TransformPageAnnotations, PageObjectInfo