pdfRestoreGraphicState
Emit a Q (restore graphics state) operator and pop the
BOOL32 __stdcall pdfRestoreGraphicState(PPDF IPDF);
function pdfRestoreGraphicState(const IPDF: PPDF): LongBool; stdcall;
Purpose. Emit a Q (restore graphics state) operator and pop the tracked CTM stack — the counterpart of pdfSaveGraphicState (Document Info & Structure Tree).
Description. Both pdfSaveGraphicState/pdfRestoreGraphicState are real: they write the actual q/Q content-stream operators and maintain a parallel internal CTM stack (PushCTM/PopCTM) so that pdfGetMatrix (Coordinate Transform and Matrix) correctly reflects the restored transform after a Q, not just the PDF viewer's own state.
Return value. True if there is a current content stream; False otherwise.
See also. pdfSaveGraphicState, pdfGetMatrix.
C# (P/Invoke)
[return: MarshalAs(UnmanagedType.Bool)]
Core
pdfRestoreGraphicState
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
Worked examples — complete programs in ten languages.