pdfMultiplyMatrix
Pure matrix-math utility: multiply two 2D affine matrices
BOOL32 __stdcall pdfMultiplyMatrix(TCTM* M1, TCTM* M2, TCTM* NewMatrix);
function pdfMultiplyMatrix(var M1, M2, NewMatrix: TCTM): LongBool; stdcall;
Purpose. Pure matrix-math utility: multiply two 2D affine matrices (M1 x M2), writing the product into NewMatrix.
Description. The only function in this chapter — and one of very few in this entire volume — that takes no IPDF document handle at all; it performs standard 2D affine matrix multiplication (a/b/c/d combined via the conventional 2x3 composition, x/y combined as a translated point) with no content-stream interaction and no document state read or written. Useful for precomputing a combined transform (e.g. rotate-then-scale) before passing the single result to pdfSetMatrix in one cm operator instead of two.
Parameters.
| Parameter | Description |
|---|---|
M1 | Left-hand matrix (applied first). |
M2 | Right-hand matrix (applied second). |
NewMatrix | Output: M1 x M2. |
Return value. True unless any of M1/M2/NewMatrix is a null pointer.
See also. pdfSetMatrix.
C# (P/Invoke)
[return: MarshalAs(UnmanagedType.Bool)]
Core
pdfMultiplyMatrix
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
Worked examples — complete programs in ten languages.