THotPDF.RegisterICCProfile Method
Validates and registers a reusable ICC v2 or v4 profile as an ICCBased colour-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 colour-space signature |
AlternateCS | Matching DeviceGray, DeviceRGB, or DeviceCMYK fallback; an empty value derives it from the profile |
Return value
Returns the reusable colour-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 colours and raw image samples to sRGB through Windows colour management, honours the PDFrirendering intent, and uses/Alternateonly when conversion is unavailable - Use the returned name with
THPDFPage.SetFillColorSpace,SetStrokeColorSpace,SetTransparencyGroupICC, orTHotPDF.RegisterDefaultColorSpace