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 在公开元数据之前验证 128 字节的文件头、声明的文件大小、acsp 签名、色彩空间分量数、有界的标签数、标签表范围以及每个标签数据区间
结果包括原始的四字节版本与色彩空间签名、显示值、分量数与标签数、配置文件 ID、完整文件的 MD5、SHA-256、设备类、PCS 以及首个有效的配置文件描述
通用检查器可识别 GRAY、RGB、CMYK 以及 2CLR 到 FCLR 的签名;特定格式的验证器可以施加更窄的印刷色彩策略
PdfIccProfileDescriptionMatches 检查 v2 的 desc 值,或 v4 mluc profileDescriptionTag 中的每个有界区域设置记录
| Limit | Default | Purpose |
|---|---|---|
MaxProfileBytes | 64 MiB | 停止对超大配置文件进行解析和哈希 |
MaxTagCount | 4096 | 约束标签表遍历 |
TPdfIccProfileInfo.IsValid 仅在问题集合为空时为 True