pdfDrawPostScriptXObject
Register a PostScript XObject (/Subtype /PS, a legacy PDF
int32_t __stdcall pdfNewPostScriptXObjectA(PPDF IPDF, const char* PS);
int32_t __stdcall pdfNewPostScriptXObjectW(PPDF IPDF, const wchar_t* PS);
int32_t __stdcall pdfDrawPostScriptXObject(PPDF IPDF, int32_t PSRef);
function pdfNewPostScriptXObjectA(const IPDF: PPDF; PS: PAnsiChar): Integer; stdcall;
function pdfNewPostScriptXObjectW(const IPDF: PPDF; PS: PWideChar): Integer; stdcall;
function pdfDrawPostScriptXObject(const IPDF: PPDF; PSRef: Integer): Integer; stdcall;
Purpose. Register a PostScript XObject (/Subtype /PS, a legacy PDF mechanism for embedding a PostScript calculator/language fallback) and draw it onto the current page.
Description. pdfDrawPostScriptXObject is a confirmed no-op beyond bookkeeping validation. pdfNewPostScriptXObjectA/W do genuinely store the PostScript source text (NewPSXObjectH, into an internal array, returning a real 1-based handle) — but pdfDrawPostScriptXObject's entire implementation is a range check only (Result := (PSRef >= 1) and (PSRef <= FPSXCount)): it never writes a /PS XObject reference into the page's content stream or resource dictionary, and the stored PostScript source is never serialized into the output PDF at all. Calling this pair produces no visible or embedded effect on the output document beyond the initial in-memory registration.
Parameters.
| Parameter | Description |
|---|---|
IPDF | Document handle. |
PS | *(New only)* PostScript source text, stored but never emitted to output. |
PSRef | *(Draw only)* A handle from pdfNewPostScriptXObject; only range-validated, never actually drawn. |
Return value. pdfNewPostScriptXObject: the new (inert) handle; 0 if IPDF is invalid. pdfDrawPostScriptXObject: 1 if PSRef is in range; 0 otherwise — does not indicate anything was drawn.
C# (P/Invoke)
public static extern int pdfDrawPostScriptXObject(IntPtr IPDF, int PSRef);
Vector Graphics
pdfDrawPostScriptXObject
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
Worked examples — complete programs in ten languages.