PDFium Delphi Component Docs

FPdfIccProfile unit

Unit: FPdfIccProfile
Bounded ICC profile header and tag-table inspection for standards validation and production evidence

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 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

Limits

LimitDefaultPurpose
MaxProfileBytes64 MiBStops parsing and hashing oversized profiles
MaxTagCount4096Bounds tag-table traversal

Remarks

See Also

FPdfPdfvtMime