PDFium Delphi Component 文件

FPdfIccProfile 單元

單元: FPdfIccProfile
用於標準驗證與生產證據的有界 ICC 描述檔檔頭與標籤表檢查

Syntax

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;

Description

InspectPdfIccProfile 在公開中繼資料之前,會驗證 128 位元組檔頭、宣告的檔案大小、acsp 簽章、色彩空間元件數、有界的標籤數、標籤表範圍,以及每個標籤資料範圍

結果包含原始四位元組版本與色彩空間簽章、顯示值、元件與標籤計數、描述檔 ID、整個檔案的 MD5、SHA-256、裝置類別、PCS,以及第一個有效的描述檔描述

通用檢查器可識別 GRAY、RGB、CMYK 與 2CLR 到 FCLR 的簽章;格式專屬驗證器可能施加更嚴格的印刷色彩政策

PdfIccProfileDescriptionMatches 會檢查 v2 desc 值,或 v4 mluc profileDescriptionTag 中的每個有界地區設定記錄

限制

LimitDefaultPurpose
MaxProfileBytes64 MiB停止解析與雜湊超過大小的描述檔
MaxTagCount4096限制標籤表走訪範圍

Remarks

See Also

FPdfPdfvtMime