ExtractAllAttachments

Description

Extract all attachments from the PDF document to a folder.

Applies to

PDFDocExtractor object

Syntax

long ExtractAllAttachments(string destFilePath)

Argument

Description

destFilePath

The path to save the attachment(s). The path will be auto created if it does not exist.


Return value

Long. Returns 1 if it succeeds and -1 if it fails. For more errors, see the Error Codes.

Examples

This example extracts all the attachments of "extract.pdf" into the “D:\Save" folder. The folder will be auto created if it does not exist in the current directory yet:

long ll_open
PDFDocExtractor lpdf_docExt
lpdf_docExt = create PDFDocExtractor
ll_open = lpdf_docExt.open("D:\extract.pdf" )
lpdf_docExt.extractallattachments("D:\file" )
lpdf_docExt.close()

This example extracts all the attachments of "extract.pdf" and save into the "file" folder in the same directory. . The folder will be auto created if it does not exist in the current directory yet:

PDFDocExtractor lpdf_docExt
lpdf_docExt = create PDFDocExtractor

ll_open = lpdf_docExt.open("extract.pdf" )
//Extract all attachments. The "file" folder will be created if it does not exist in the current directoy
lpdf_docExt.extractallattachments("file" )
lpdf_docExt.close()

See also

Close

ExtractAttachmentFile

GetAttachmentList

GetPageCount

GetPageSize

Open