PDFium Component Docs

คลาส TPdfMatrix

Unit: FPdfMatrix
ตัวห่อแบบ OO ที่แก้ไขได้รอบ FS_MATRIX ของ PDFium สำหรับประกอบการแปลงใน user-space ของ PDF

Syntax

type TPdfMatrix = class ... end;

Methods

MemberDescription
CreateCreate an identity matrix, a six-value matrix, or a defensive copy from FS_MATRIX
ResetReset the matrix to identity
MultiplyPost-multiply by another TPdfMatrix or explicit a through f values
TranslateAppend a translation by deltaX and deltaY
ScaleAppend separate X and Y scale factors
RotateAppend a clockwise or counter-clockwise rotation in degrees or radians
HorizontalFlipAppend an X-axis flip
VerticalFlipAppend a Y-axis flip
CentralFlipAppend both axis flips, equivalent to a 180-degree rotation without trigonometry
SkewAppend separate X and Y shear angles

Properties

PropertyTypeDescription
aSingleRead-only first matrix element
bSingleRead-only second matrix element
cSingleRead-only third matrix element
dSingleRead-only fourth matrix element
eSingleRead-only translation X element
fSingleRead-only translation Y element
HandleFS_MATRIXRaw matrix value for PDFium APIs that accept FS_MATRIX or PFS_MATRIX

Description

TPdfMatrix uses the PDF affine layout a b c d e f and post-multiplies each operation, so calls read in the same order as the transforms applied to points

Use Handle with APIs such as FPDFPageObj_SetMatrix, FPDFPageObj_Transform, and FPDFText_SetMatrix

Example

var
  Matrix: TPdfMatrix;
begin
  Matrix := TPdfMatrix.Create;
  Matrix.Scale(0.5, 0.5);
  Matrix.Rotate(15);
  Matrix.Translate(72, 72);
  FPDFPageObj_SetMatrix(ObjectHandle, @Matrix.Handle);
end;

See Also

TPdf.CreateXObjectFromPage, TPdf.InsertFormObjectFromXObject