API reference › Import & Output APIs
pdfSaveGraphicState
Emit a q operator (save graphics state) into the current
Purpose — Emit a q operator (save graphics state) into the current page content and push the engine's CTM tracker.
Description — Pair every call with pdfRestoreGraphicState (Q); pdfContentStreamSafe checks the balance. Requires an open page.
C
BOOL32 __stdcall pdfSaveGraphicState(PPDF IPDF);
Return value — TRUE; FALSE when no page is open.
Collections, images-from-buffer, ICC
C# (P/Invoke)
wrappers/dotnet/LumasPdf.cs
[return: MarshalAs(UnmanagedType.Bool)]
Area
Import & Output APIs
Category
Core
Exported names
pdfSaveGraphicState
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.