Enterprise edition: link FPdfEnterprise with Lib\Enterprise on the search path; otherwise this method raises EPdfEnterpriseRequired; see the edition matrix
function ValidatePdfE: TPdfEValidationResult;
ValidatePdfE walks the open document looking for the PDF/E-1 file-format markers defined by ISO 24517-1:2008:
pdfe:ISO_PDFEVersion (§5 + §13.3)pdfaExtension:schemas description for the pdfe namespace (XMP Specification 2004 extension-schema requirement, inherited via §13.1)/ISO_PDFEVersion with a literal-string value (§5 SHALL)/ID array (§6.2)xmp:CreateDate and xmp:ModifyDate entries in XMP (inherited from ISO 19005-1 §6.7 via §13.1)The result is a TPdfEValidationResult record:
pec1 (PDF/E-1 identifier found and non-empty), pecNone (no PDF/E marker), or pecUnknown (parsing failed or marker present but value missing)TPdfEValidationIssues set containing zero or more values: pveiMissingXmpMetadata, pveiMissingPdfEIdentifier, pveiMissingExtensionSchema, pveiMissingInfoVersionEntry, pveiInfoVersionMismatch, pveiMissingTrailerId, pveiMissingXmpDates. Content-prohibition checks: pveiLzwForbidden (/LZWDecode filter present), pveiJavaScriptForbidden (/JavaScript action or name present), pveiFormFieldsForbidden and pveiEmbeddedFilesForbidden (reserved: clause 10 permits AcroForm and clause 14 permits embedded files, so neither is raised any longer, whilst XFA and NeedAppearances keep their own values),pveiOpiForbidden (/OPI or /Alternates present), pveiPdfiumFontNotEmbedded (a font used on a page is not embedded per FPDFFont_GetIsEmbedded). ISO 24517-1 hard requirements: pveiBadPdfVersion (header is not %PDF-1.6; §5 fixes the base version), pveiMissingOutputIntent (catalogue /OutputIntents absent or empty), pveiMissingIccProfile (OutputIntent /DestOutputProfile absent), pveiFontNotEmbedded (a font is used but no font programme is embedded). Interactive-form checks (clause 10): pveiXfaPresent (AcroForm top-level /XFA entry present), pveiNeedAppearancesTrue (AcroForm top-level /NeedAppearances resolves to true). Byte-level rule scans shared with the PDF/A validator: pveiHexStringOddDigits and pveiHexStringInvalidChar (§6.6 hexadecimal strings), pveiExternalStreamRef (stream dictionary carries /F, /FFilter or /FDecodeParms, §6.7), pveiIntegerImplementationLimit, pveiNameOverLimit and pveiDeviceNOverLimit (§6.9 implementation limits), pveiDeviceNNChannel (DeviceN with an /NChannel subtype, §7.3.4), pveiImageInterpolateTrue (§7.4), pveiPostScriptForbidden (PostScript XObject, or a form XObject with a /PS key or /Subtype2 of PS, §7.5 and §7.7), pveiReferenceXObjectForbidden (§7.6), pveiExtGStateTransferFunction (/TR present or /TR2 other than Default, §7.9), pveiUsageCategoryInvalid (optional-content usage application listing CreatorInfo or User, §7.12), pveiAnnotationFlagsViolation (annotation without /F, without the Print bit, or with Hidden / Invisible / NoView set, §9.3), pveiForbiddenAction (/ImportForm, deprecated set-state or no-op action, §11.1), pveiXmpHeaderAttributes (bytes= or encoding= in the xpacket header, §13.4), pveiMissingXmpRequiredProperties (any of xmpMM:DocumentID, xmpMM:VersionID, xmpMM:RenditionClass, xmp:MetadataDate, dc:title absent or zero-length, §13.5), pveiMediaMustHaveParameters (a media dictionary carrying /MH, §15.4) and pveiAlternatePresentations (Names dictionary /AlternatePresentations entry, §15.5)Conformance is a real PDF/E level and Issues is emptyValidatePdfE is a read-only inspection — it does not modify
the document and is safe to call repeatedly. Use it before pushing a
PDF/E payload into an engineering archive to surface the
non-conformances this library can detect. For the
common "is this PDF/E-1?" check that doesn't need the issue list,
prefer the lighter-weight PdfEConformance property
pveiInfoVersionMismatch only when both Info /ISO_PDFEVersion and XMP pdfe:ISO_PDFEVersion are present and disagree. When the Info entry is absent the validator reports pveiMissingInfoVersionEntry only (no spurious mismatch)Conformance = pecUnknown and an empty Issues set
uses System.TypInfo;
var
Outcome: TPdfEValidationResult;
Issue: TPdfEValidationIssue;
begin
Pdf1.FileName := 'C:\Incoming\drawing.pdf';
Pdf1.Active := True;
Outcome := Pdf1.ValidatePdfE;
Memo1.Lines.Add('Level: ' + GetEnumName(TypeInfo(TPdfEConformance),
Ord(Outcome.Conformance)));
for Issue in Outcome.Issues do
Memo1.Lines.Add('- ' + GetEnumName(TypeInfo(TPdfEValidationIssue), Ord(Issue)));
end;