API referenceGraphics

pdfGetMatrix

Read the current accumulated transformation matrix.

C
BOOL32 __stdcall pdfGetMatrix(PPDF IPDF, TCTM* M);
Delphi
function pdfGetMatrix(const IPDF: PPDF; var M: TCTM): LongBool; stdcall;

Purpose. Read the current accumulated transformation matrix.

Description. Returns the document's tracked FCTM (via GetCurrentMatrix) into M.a/b/c/d/x/y — the composition of every pdfSetMatrix/pdfRotateCoords/pdfScaleCoords/pdfSkewCoords/ pdfTranslateCoords call issued since the current page/template was opened (the CTM resets per page/template, not per document). Requires an open current page (D.HaveOpenPage) — unlike the setters below, which only require a current content stream (so they also work while editing a template). Calling pdfGetMatrix while only a template is open (no open page) fails even though the setters would have succeeded in that same context.

Parameters.

ParameterDescription
IPDFDocument handle.
MOutput: the current [a b c d x y] matrix.

Return value. True if a page is currently open and M was filled; False otherwise (including while only a template — not a page — is open).

See also. pdfSetMatrix.

C# (P/Invoke)

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

Getters

Exported names

pdfGetMatrix

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.