TPdfIccProfileLimits = record
MaxProfileBytes: Int64;
MaxTagCount: Integer;
class function Default: TPdfIccProfileLimits; static;
end;
TPdfIccProfileIssue = (ipiTooLarge, ipiHeaderTruncated, ipiSizeMismatch, ipiSignatureInvalid, ipiUnsupportedColorSpace, ipiTagCountExceeded, ipiTagTableTruncated, ipiTagDataOutOfBounds);
TPdfIccProfileIssues = set of TPdfIccProfileIssue;
TPdfIccProfileInfo = record
Issues: TPdfIccProfileIssues;
ByteSize: Int64;
DeclaredSize: Int64;
Version: string;
VersionBytes: AnsiString;
DeviceClass: string;
DataColorSpace: string;
DataColorSpaceSignature: AnsiString;
Pcs: string;
ComponentCount: Integer;
TagCount: Integer;
Md5: string;
Sha256: string;
ProfileId: string;
ProfileDescription: string;
function IsValid: Boolean;
end;
function InspectPdfIccProfile(const Data: TBytes): TPdfIccProfileInfo;
function InspectPdfIccProfile(const Data: TBytes;
const Limits: TPdfIccProfileLimits): TPdfIccProfileInfo;
function PdfIccProfileDescriptionMatches(const Data: TBytes;
const Expected: string): Boolean;
InspectPdfIccProfile validates the 128-byte header, declared file size, acsp signature, colour-space component count, bounded tag count, tag-table extent and every tag-data range before exposing metadata
The result includes raw four-byte version and colour-space signatures, display values, component and tag counts, profile ID, MD5 of the complete file, SHA-256, device class, PCS and the first valid profile description
GRAY, RGB, CMYK and 2CLR through FCLR signatures are recognised by the general inspector; format-specific validators may impose a narrower process-colour policy
PdfIccProfileDescriptionMatches checks the v2 desc value or every bounded locale record in a v4 mluc profileDescriptionTag
| Limit | Default | Purpose |
|---|---|---|
MaxProfileBytes | 64 MiB | Stops parsing and hashing oversized profiles |
MaxTagCount | 4096 | Bounds tag-table traversal |
TPdfIccProfileInfo.IsValid is True only when the issue set is empty