API reference › Rendering & Viewer
pdfAddRenderingIntent
Despite the source's own section-header comment marking
int32_t __stdcall pdfAddRenderingIntentA(PPDF IPDF, const char* ICCFile);
int32_t __stdcall pdfAddRenderingIntentEx(PPDF IPDF, void* Buffer, uint32_t BufSize);
function pdfAddRenderingIntentA(const IPDF: PPDF; const ICCFile: PAnsiChar): Integer; stdcall;
function pdfAddRenderingIntentEx(const IPDF: PPDF; const Buffer: Pointer; BufSize: Cardinal): Integer; stdcall;
Purpose. Despite the source's own section-header comment marking this cluster "ICC rendering intent profile (subsystem not implemented)", the implementation is real: both embed an ICC profile as a document /OutputIntent (AddOutputIntent, NComps=3, OutCond='Rendering'), from a file (A/W) or an in-memory buffer (Ex).
Description. AddOutputIntent stores the raw ICC bytes, clamps NComps to {1,3,4} (defaulting to 3 if given anything else — moot here since this wrapper always passes 3), defaults OutCond to 'sRGB' if empty (moot here, always 'Rendering'), and returns the new output-intent's index — a genuine, real output-intent entry that reaches serialization (the stale "subsystem not implemented" comment appears to predate this function actually being wired up; do not trust it over the code). The A/W file variants read the whole file via TFile.ReadAllBytes; Ex uses the caller's buffer directly.
Parameters.
| Parameter | Description |
|---|---|
IPDF | Document handle. |
ICCFile | Path to an ICC profile file (A/W); must exist and be non-empty. |
Buffer, BufSize | *(Ex only)* In-memory ICC profile bytes. |
Return value. The new output-intent's 0-based index; -1 on any failure (IPDF invalid, file missing/empty, empty buffer).
C# (P/Invoke)
public static extern int pdfAddRenderingIntentA(IntPtr IPDF, [MarshalAs(UnmanagedType.LPStr)] string ICCFile);
public static extern int pdfAddRenderingIntentW(IntPtr IPDF, [MarshalAs(UnmanagedType.LPWStr)] string ICCFile);
Content Creation
pdfAddRenderingIntentA
pdfAddRenderingIntentW
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
Worked examples — complete programs in ten languages.