THotPDF.RegisterICCProfile Method
Validates and registers a reusable ICC v2 or v4 profile as an ICCBased color-space resource
Declaration
function RegisterICCProfile(const ProfileFileName: AnsiString; NumComponents: Integer; const AlternateCS: AnsiString= ''): AnsiString; overload;
function RegisterICCProfile(ProfileStream: TStream; NumComponents: Integer; const AlternateCS: AnsiString= ''): AnsiString; overload;
function RegisterICCProfile(const ProfileFileName: AnsiString; const AlternateCS: AnsiString= ''): AnsiString; overload;
function RegisterICCProfile(ProfileStream: TStream; const AlternateCS: AnsiString= ''): AnsiString; overload;
Unit
HPDFDoc
Parameters
| Name | Purpose |
|---|---|
ProfileFileName | Path to the ICC profile |
ProfileStream | ICC profile stream whose current position is preserved |
NumComponents | Expected profile component count, which must match the ICC data color-space signature |
AlternateCS | Matching DeviceGray, DeviceRGB, or DeviceCMYK fallback; an empty value derives it from the profile |
Return value
Returns the reusable color-space resource name such as CS1
Usage notes
- The profile header,
acspsignature, declared size, version, PCS, rendering intent, tag table, tag bounds, and component count are validated before an indirect object is created - The overloads without
NumComponentsinfer one, three, or four components from GRAY, RGB, or CMYK profile data - Registering identical bytes returns the existing resource name instead of embedding a duplicate profile
- Loaded-page rendering transforms valid
ICCBasedvector colors and raw image samples to sRGB through the embedded ICC pipeline, honors all PDFrirendering intents, applies configured black-point compensation, and uses/Alternateonly when conversion is unavailable - Use the returned name with
THPDFPage.SetFillColorSpace,SetStrokeColorSpace,SetTransparencyGroupICC, orTHotPDF.RegisterDefaultColorSpace