API referenceGraphics

pdfMultiplyMatrix

Pure matrix-math utility: multiply two 2D affine matrices

C
BOOL32 __stdcall pdfMultiplyMatrix(TCTM* M1, TCTM* M2, TCTM* NewMatrix);
Delphi
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.

ParameterDescription
M1Left-hand matrix (applied first).
M2Right-hand matrix (applied second).
NewMatrixOutput: M1 x M2.

Return value. True unless any of M1/M2/NewMatrix is a null pointer.

See also. pdfSetMatrix.

C# (P/Invoke)

wrappers/dotnet/LumasPdf.cs
[return: MarshalAs(UnmanagedType.Bool)]
Area
Graphics
Category

Core

Exported names

pdfMultiplyMatrix

String variants

The …A form takes UTF-8, …W takes UTF-16; a bare name aliases the ANSI form.

See working code

Worked examples — complete programs in ten languages.