API reference › Import & Output APIs
pdfReplaceICCProfile
Replace the profile bytes of an existing ICCBased color
Purpose — Replace the profile bytes of an existing ICCBased color space (handle from pdfCreateICCBasedColorSpace…).
C
int32_t __stdcall pdfReplaceICCProfileA(PPDF IPDF, uint32_t ColorSpace, const char* ICCFile);
int32_t __stdcall pdfReplaceICCProfileW(PPDF IPDF, uint32_t ColorSpace, const wchar_t* ICCFile);
Return value — 1 on success; 0 when the file is missing/empty, the handle is unknown, or the color space is not ICCBased.
C# (P/Invoke)
wrappers/dotnet/LumasPdf.cs
public static extern int pdfReplaceICCProfileA(IntPtr IPDF, uint ColorSpace, [MarshalAs(UnmanagedType.LPStr)] string ICCFile);
public static extern int pdfReplaceICCProfileW(IntPtr IPDF, uint ColorSpace, [MarshalAs(UnmanagedType.LPWStr)] string ICCFile);
Area
Import & Output APIs
Category
Core
Exported names
pdfReplaceICCProfileA
pdfReplaceICCProfileW
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.