API referenceText

pdfWriteTextMatrix

Draw text with an explicit text-space transformation matrix

CategoryText output
Noteweaker Unicode support than pdfWriteText (see the chapter-level table)

Purpose — Draw text with an explicit text-space transformation matrix (arbitrary rotation/skew/scale), instead of just an (X, Y) origin.

Description — Emits the PDF Tm operator with your matrix directly, so this is the API to use for rotated, sheared, or non-uniformly scaled text. Font-kind dispatch (TrueType → Identity-H GIDs; standard 14/Type 1 → raw bytes) mirrors pdfWriteText, but — verified — neither the CID-predefined-font branch nor the Unicode-safe WinAnsi transcode/fallback-font upgrade exist here. The non-TrueType W path does a bare RawByteString(AnsiString(Text)) cast, which uses the process's ambient ANSI code page (CP_ACP), not the WinAnsi-safe CP1252 path pdfWriteText uses.

Declarations

C
BOOL32 __stdcall pdfWriteTextMatrixA(PPDF IPDF, TCTM* Matrix, const char* AText);
BOOL32 __stdcall pdfWriteTextMatrixW(PPDF IPDF, TCTM* Matrix, const wchar_t* AText);
Delphi
function pdfWriteTextMatrixA(const IPDF: PPDF; var Matrix: TCTM; const AText: PAnsiChar): LongBool; stdcall; external 'LumasPdf.dll';
function pdfWriteTextMatrixW(const IPDF: PPDF; var Matrix: TCTM; const AText: PWideChar): LongBool; stdcall; external 'LumasPdf.dll';

TCTM (from Lumas.Pdf.Types — the standard 6-element PDF transform matrix):

Delphi
TCTM = record
  a, b, c, d, x, y: Double;   // [a b 0; c d 0; x y 1]
end;

Parameters

ParameterTypeDescription
IPDFPPDFInstance handle with an open page and font.
MatrixTCTMText-space matrix; despite the var/pointer shape, this is read-only input, never written back.
ATextstringText to draw.

Return valueTRUE on success; FALSE on any missing precondition or empty text.

See alsopdfWriteTextMatrixEx, pdfWriteText

C# (P/Invoke)

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

Text

Exported names

pdfWriteTextMatrixA pdfWriteTextMatrixW

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.