| Category | Text output |
|---|---|
| Note | weaker 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
BOOL32 __stdcall pdfWriteTextMatrixA(PPDF IPDF, TCTM* Matrix, const char* AText);
BOOL32 __stdcall pdfWriteTextMatrixW(PPDF IPDF, TCTM* Matrix, const wchar_t* AText);
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):
TCTM = record
a, b, c, d, x, y: Double; // [a b 0; c d 0; x y 1]
end;
Parameters
| Parameter | Type | Description |
|---|---|---|
IPDF | PPDF | Instance handle with an open page and font. |
Matrix | TCTM | Text-space matrix; despite the var/pointer shape, this is read-only input, never written back. |
AText | string | Text to draw. |
Return value — TRUE on success; FALSE on any missing precondition or empty text.
See also — pdfWriteTextMatrixEx, pdfWriteText
C# (P/Invoke)
[return: MarshalAs(UnmanagedType.Bool)]
Text
pdfWriteTextMatrixA
pdfWriteTextMatrixW
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
Worked examples — complete programs in ten languages.