AddFileAttachmentA

Propriedades do documento

Descrição

The trailing A denotes the ANSI (char) DLL entry point; the ActiveX/COM surface exposes only the Unicode form. Behaviour is identical to AddFileAttachment and string arguments are interpreted using the current SetAnsiMode code page

Registra um arquivo embutido existente como anexo de nível de documento no visualizador de PDF. Leitores que expõem o painel Attachments mostram o título fornecido e abrem o arquivo embutido referenciado quando o usuário o seleciona

Call AddEmbeddedFile first to copy the file bytes into the document and obtain the EmbeddedFileID. AddFileAttachment then adds that file specification to the Catalog /Names /EmbeddedFiles name tree without duplicating the embedded bytes.

PDF version behavior: AddEmbeddedFile emits embedded file stream and file specification dictionaries, which require PDF 1.3. Registering the file in the document-level /Names /EmbeddedFiles name tree requires PDF 1.4. If the current document version is lower and the save version is not locked, AddFileAttachment automatically raises the document to PDF 1.4 and records /EmbeddedFiles name tree in AutoBumpedFeatures. If the caller locks a lower save version, the compatibility gate rejects the save with LastErrorCode 602.

Sintaxe

Delphi

Function DLAddFileAttachmentA(InstanceID: Integer; Title: PAnsiChar; EmbeddedFileID: Integer): Integer;

DLL

int DLAddFileAttachmentA(int InstanceID, const char * Title, int EmbeddedFileID);

Parâmetros

TitleThe attachment name shown in the viewer and used as the key in the /EmbeddedFiles name tree. It must not be blank.
EmbeddedFileIDThe value returned by AddEmbeddedFile.

Valores retornados

0The EmbeddedFileID is invalid, the title is blank, or no document is active.
1The embedded file was registered as a document-level attachment.

Observações

This function creates a document-level attachment list entry. To place a clickable icon or hotspot on a page, use AddLinkToEmbeddedFile instead. To embed and register a file in one call, use EmbedFile.

Veja também

AddEmbeddedFile, AddLinkToEmbeddedFile, EmbedFile, SetEmbeddedFileAFRelationship, EmbeddedFileCount