API reference › Import & Output APIs
pdfEncapsulateContentStream
Wrap the current page's entire content in q … Q so its
Purpose — Wrap the current page's entire content in q … Q so its graphics-state changes cannot leak into content appended afterwards.
Description — Reads the open page's content bytes and rewrites them as q\n<content>Q\n. Typical use: after importing a page with ifImportAsPage or after pdfSetContent, before stamping additional content on top.
int32_t __stdcall pdfEncapsulateContentStream(PPDF IPDF);
Return value — 1 on success; 0 if no page is open (or invalid handle). Integer, not BOOL32.
C# (P/Invoke)
public static extern int pdfEncapsulateContentStream(IntPtr IPDF);
Core
pdfEncapsulateContentStream
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
Worked examples — complete programs in ten languages.