AddFile

Description

Specifies a file to add as attachment of a PDF document.

Applies to

PDFAttachment object

Syntax

long AddFile(string localFilePath)

Argument

Description

localFilePath

The path and file name of the local file to add.


Return value

Long. Returns 1 if it succeeds and -1 if an error occurs. For the full list of error codes, see Error Codes.

Usage

Call the function to add the files in the specified folder as attachments of the PDF document. The isRecursive argument controls whether to also add the files in the sub folders.

Examples

This example add all the files, including the files in the sub folders, in the "D:\image" folder as attachments to the newly-created PDF document.

lpdf_doc = create PDFdocument
lpdf_attach = create PDFattachment

lpdf_attach.addfile ( "D:\image\image.png")
lpdf_doc.attachment = lpdf_attach

See also

AddFolder

GetCount

RemoveAll