ValidateAttachmentChecksum
Document properties, Extraction
Description
Decodes an enumerated attachment payload on demand, computes its MD5 digest, and compares it with the hexadecimal /Params /CheckSum value reported by EnumAttachments
Syntax
Delphi
Function TPDFlib.ValidateAttachmentChecksum(Const Attachment: TPDFlibAttachment): Integer;
Parameters
| Attachment | A record returned by EnumAttachments |
|---|
Return values
| 1 | The decoded payload matches the stored checksum |
|---|---|
| 0 | The payload does not match the stored checksum |
| -1 | No checksum is present, the record is out of range, or the payload cannot be read |
Remarks
Checksum validation is explicit so metadata-only enumeration does not read and hash large attachment payloads
New attachments created from files or byte strings receive a checksum automatically
See also
EnumAttachments, TPDFlibAttachment, GetEmbeddedFileContentToStream