PDFium Delphi Component Docs

TPdf.ValidatePdfMac

Syntax

function ValidatePdfMac(const Password: AnsiString): TPdfMacValidationResult;

Description

Validates an ISO/TS 32004 standalone PDF MAC on the active document using the supplied user or owner password

The method reads the exact original file, buffered memory or custom stream bytes and never validates a PDFium-resaved copy

Validation requires PDF 2.0, the ISO 32004 developer extension, Standard Security Handler revision 5 or 6, a cleared PDF MAC permission bit, a direct standalone /AuthCode, a strict two-segment /ByteRange that reaches physical EOF, canonical CMS DER, the required authenticated attributes, a valid wrapped MAC key, and a matching HMAC value

Result

StatusMeaning
pmvsValidThe password unlocked the file key and every supported PDF MAC check succeeded
pmvsNotPresentThe active source has no standalone authentication code
pmvsInvalidThe structure, password, key material, ByteRange, digest or MAC value failed validation
pmvsUnsupportedThe source is incomplete or uses a PDF MAC placement outside the supported standalone scope

Remarks

See Also

FPdfEncrypt, FPdfMac, TPdf.SaveAsEncrypted