PDFium Delphi Component Docs

InspectPdfAMetadata method

Component: TPdf  ·  Unit: PDFium
Reports exact ISO 19005-1 Info-to-XMP equivalence for the active document

Syntax

function InspectPdfAMetadata: TPdfAMetadataReport;

ResultTPdfAMetadataReport containing XMP availability, parse error text, mismatch fields, and eight per-field comparisons

Description

The method reads Title, Author, Subject, Keywords, Creator, Producer, CreationDate, and ModDate through PDFium so PDFDocEncoding and UTF-16 strings use the same Unicode decoding as the live document

Raw dictionary inspection records whether each Info key exists independently from its value, so an explicitly empty string is not treated as an absent key

Title and Subject require an rdf:Alt value tagged x-default; Author requires an rdf:Seq containing exactly one value; the other mappings require a simple property found by namespace URI and local name

Text values compare by exact Unicode code points; dates compare as local components when neither value has a timezone or as UTC instants when both values carry timezones

TPdfAMetadataState distinguishes not-required, equivalent, missing XMP, wrong RDF type, value mismatch, invalid Info date, and invalid XMP date states

The method is read-only, requires an active document, and does not modify PDFium or source state

Example

var Report: TPdfAMetadataReport;
Report := Pdf1.InspectPdfAMetadata;
if Report.HasXmpPacket and not Report.IsEquivalent then
  ShowMessage(IntToStr(Length(Report.Comparisons)) + ' fields inspected');

See Also

NormalizePdfAMetadata, ValidatePdfA, ReadXmpPacket, FPdfXmp