TPDFlibAttachment

Data Types

Description

TPDFlibAttachment is a unified record structure that describes an embedded file attachment, whether it originates from a document-level name tree or a page-level file attachment annotation.

Syntax

Delphi

type TPDFlibAttachment = record
    Source: TPDFlibAttachmentSource;
    Index: Integer;
    Page: Integer;
    FileName: WideString;
    MIMEType: WideString;
    Description: WideString;
    Size: Int64;
    CreationDate: WideString;
    ModificationDate: WideString;
    Checksum: AnsiString;
    AFRelationship: WideString;
    ObjectNumber: Integer;
  end;

Fields

SourceThe attachment origin specified by TPDFlibAttachmentSource
IndexThe 1-based index within its own source collection
PageThe 1-based page number for asAnnotAttachment, or 0 for asEmbeddedFile
FileNameThe Unicode file specification name from /UF or /F
MIMETypeThe embedded stream MIME subtype
DescriptionThe file specification or annotation description
SizeThe uncompressed byte size from /Params /Size, or 0 when absent
CreationDateThe original /Params /CreationDate PDF date string
ModificationDateThe original /Params /ModDate PDF date string
ChecksumThe lower-case hexadecimal form of /Params /CheckSum, or an empty string when absent
AFRelationshipThe associated-file relationship name such as Source, Data, or Alternative
ObjectNumberThe indirect object number of the file specification, or 0 for a malformed direct specification

See also

EnumAttachments reads metadata only and does not hash attachment payloads, so enumerating large files remains inexpensive

Call ValidateAttachmentChecksum when payload integrity must be verified

See also

TPDFlibAttachmentSource, EnumAttachments, ValidateAttachmentChecksum, SaveAllAttachments