AddEmbeddedFile

Document properties

Description

Embeds a file into the PDF but does not link it to any part of the document.

The AddFileAttachment function can be used to make the embedded file available as an attachment in the PDF viewer. The PDF viewer must support this functionality (Adobe Reader 7 and later). This process can be done in one step using the EmbedFile function.

The AddLinkToEmbeddedFile function can be used to create a hotspot on a page that links to the embedded file.

Syntax

Delphi

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

ActiveX

Function PDFlib::AddEmbeddedFile(FileName As String, MIMEType As String) As Long

DLL

int DLAddEmbeddedFile(int InstanceID, wchar_t * FileName, wchar_t * MIMEType);

Parameters

FileNameThe path and filename of the file to embed into the PDF.
MIMETypeThe MIME type of the embedded file. For example "image/jpeg" for a JPEG image.

Return values

0The file could not be found or there was an error embedding the file into the PDF
Non-zeroAn EmbeddedFileID that can be used with the AddFileAttachment function