API referenceCore SDK

psrTransformOp

Apply an affine transform to one content object of the

C
BOOL32 __stdcall psrTransformOp(IPSR Ctx, UI32 Index, double MA, double MB, double MC, double MD, double ME, double MF);
Delphi
function psrTransformOp(const Ctx: IPSR; Index: Cardinal; MA, MB, MC, MD, ME, MF: Double): LongBool; stdcall;

Purpose. Apply an affine transform to one content object of the parsed page — the move/scale/rotate primitive of the content-editor family (select with psrParsePage, delete with psrDeleteOperator, relocate with this call).

Description. Index uses the same index space as psrDeleteOperator: an operator-record index from the most recent psrParsePage (raw program index as the fallback). The matrix [MA MB MC MD ME MF] is applied by wrapping the object's operator range in a save/transform/restore bracket (q ... cm ... Q). A text show operator widens to its ENCLOSING text object first (BT .. ET) — state brackets are not legal inside a text object, and moving a show operator means moving its text block. For a pure translation pass the identity with offsets: 1, 0, 0, 1, dx, dy.

The edit follows the family's standard contract: it is staged on the parser context and committed to the page by psrWriteToPage; after a committed edit the operator indices are stale until the page is parsed again.

Parameters.

ParameterDescription
CtxParser context (psrCreateParserContext) with a parsed page.
IndexOperator-record index of the object to transform.
MA..MFThe affine matrix, PDF order [a b c d e f].

Return value. True once the transform is staged; False for an unparsed context or an out-of-range index.

See also. psrParsePage, psrDeleteOperator, psrWriteToPage.

C# (P/Invoke)

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

Misc

Exported names

psrTransformOp

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.