GetAttachmentList

Description

Get the list of attachments in the PDF document.

Applies to

PDFDocExtractor object

Syntax

long GetAttachmentList(ref string attachments[])

Argument

Description

attachments[]

The array of all the attached files in the PDF document. There is


Return value

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

Examples

This example gets the list of attachments of "extract.pdf" and saves it as attachments[]:

ll_open = lpdf_docExt.open("extract.pdf" )
lpdf_docExt.GetAttachmentList(ref string attachments[])

This example gets the list of attachments of "extract.pdf" and then extract the attachment file one by one:

long ll_open,ll_return,li_i
string ls_list[]

PDFDocExtractor lpdf_docExt
lpdf_docExt = create PDFDocExtractor

ll_open = lpdf_docExt.open("D:\extract.pdf" )
//ls_list has the names of all the attachment files
ll_return = lpdf_docExt.getattachmentlist(ref ls_list)
if ll_return >0 then
  for li_i = 1 to upperbound(ls_list)
  //Extracts the attachment files 
  ll_return = lpdf_docExt.extractattachmentfile(ls_list[li_i],"D:\file4\"+ls_list[li_i] )
next
end if

lpdf_docExt.close()

See also

Close

ExtractAllAttachments

ExtractAttachmentFile

GetPageCount

GetPageSize

Open