EmbedFile

Document properties

Description

Embeds a file into the PDF document and creates a file attachment link to the embedded file. The file can then be accessed in Acrobat under the File Attachments function.

This is equivalent to calling AddEmbeddedFile followed by AddFileAttachment.

Syntax

Delphi

function TPDFlib.EmbedFile(Const Title, FileName, MIMEType: WideString): Integer;

ActiveX

Function PDFlib::EmbedFile(Title As String, FileName As String, MIMEType As String) As Long

DLL

int DLEmbedFile(int InstanceID, wchar_t * Title, wchar_t * FileName, wchar_t * MIMEType);

Parameters

TitleA unique title for this file. No two files can have the same title. If a file with this title already exists in the document the new file will not be embedded.
FileNameThe full path and name of the file to embed.
MIMETypeThe optional MIME type of the file, for example "image/jpg" for a JPEG image. See http://www.iana.org/assignments/media-types/ for a full list of MIME types. If the MIME type is not known it can be set to an empty string.

Return values

0The file could not be embedded
1The file was embedded successfully