FS_MATRIX ของ PDFium สำหรับประกอบการแปลงใน user-space ของ PDFtype TPdfMatrix = class ... end;
| Member | Description |
|---|---|
Create | Create an identity matrix, a six-value matrix, or a defensive copy from FS_MATRIX |
Reset | Reset the matrix to identity |
Multiply | Post-multiply by another TPdfMatrix or explicit a through f values |
Translate | Append a translation by deltaX and deltaY |
Scale | Append separate X and Y scale factors |
Rotate | Append a clockwise or counter-clockwise rotation in degrees or radians |
HorizontalFlip | Append an X-axis flip |
VerticalFlip | Append a Y-axis flip |
CentralFlip | Append both axis flips, equivalent to a 180-degree rotation without trigonometry |
Skew | Append separate X and Y shear angles |
| Property | Type | Description |
|---|---|---|
a | Single | Read-only first matrix element |
b | Single | Read-only second matrix element |
c | Single | Read-only third matrix element |
d | Single | Read-only fourth matrix element |
e | Single | Read-only translation X element |
f | Single | Read-only translation Y element |
Handle | FS_MATRIX | Raw matrix value for PDFium APIs that accept FS_MATRIX or PFS_MATRIX |
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
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;