API referencePDF/A & Conformance

pdfAddOutputIntent

Add a real /OutputIntent — the standard PDF (and, more

C
int32_t __stdcall pdfAddOutputIntentA(PPDF IPDF, const char* ICCFile);
int32_t __stdcall pdfAddOutputIntentEx(PPDF IPDF, void* Buffer, uint32_t BufSize);
Delphi
function pdfAddOutputIntentA(const IPDF: PPDF; const ICCFile: PAnsiChar): Integer; stdcall;
function pdfAddOutputIntentEx(const IPDF: PPDF; const Buffer: Pointer; BufSize: Cardinal): Integer; stdcall;

Purpose. Add a real /OutputIntent — the standard PDF (and, more strictly, PDF/A/PDF/X-*required*) mechanism declaring the color characteristics of the intended output device via an embedded ICC profile — the mechanism most commonly needed to actually pass conformance checking (PDF/A & PDF/X Conformance Checking and Violation Reporting).

Description. This is a genuinely different ABI/wrapper pair from pdfAddRenderingIntent/pdfAddRenderingIntentEx documented in Rendering Intent and Page Render Entry Points, even though both ultimately call the exact same underlying AddOutputIntent(ICC, Len, NComps, OutCond) method. The two differ in what they hardcode: pdfAddRenderingIntent(Ex) always passes NComps=3, OutCond='Rendering'; pdfAddOutputIntentEx (this function) genuinely inspects the ICC profile's real header via ICCProfileInfo to determine the correct component count, and always passes OutCond='sRGB' — the standard GTS_PDFA1-style output intent a PDF/A/PDF/X validator actually checks for. A caller wanting a conformance-passing output intent should use this pair, not the V15 rendering-intent pair (which serves a different, display-rendering purpose despite sharing the same low-level storage).

Parameters.

ParameterDescription
IPDFDocument handle.
ICCFile*(plain form)* Path to an ICC profile file.
Buffer, BufSize*(Ex only)* In-memory ICC profile bytes; component count is genuinely detected from the profile header.

Return value. The new output-intent's 0-based index; -1 on failure (missing/empty file or buffer, IPDF invalid).

C# (P/Invoke)

wrappers/dotnet/LumasPdf.cs
public static extern int pdfAddOutputIntentA(IntPtr IPDF, [MarshalAs(UnmanagedType.LPStr)] string ICCFile);
public static extern int pdfAddOutputIntentW(IntPtr IPDF, [MarshalAs(UnmanagedType.LPWStr)] string ICCFile);
Area
PDF/A & Conformance
Category

Content Creation

Exported names

pdfAddOutputIntentA pdfAddOutputIntentW

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.