BCL easyPDF SDK
easyPDF SDK Usermanual
PDF Creator Programming API  |  Download Free Trial  |  Contact Us to Purchase

AttachFilesBatch Method

Adds a list of non-annotation type of file attachments to a PDF file.

Sub AttachFilesBatch(InputFileName As String,
                     OutputFileName As String,
                     AttachmentFileNamesArray As Variant,
                     DescriptionsArray As Variant)

void AttachFilesBatch(string InputFileName,
                      string OutputFileName,
                      string[] AttachmentFileNamesArray,
                      string[] DescriptionsArray)

void AttachFilesBatch(String InputFileName,
                      String OutputFileName,
                      String[] AttachmentFileNamesArray,
                      String[] DescriptionsArray) throws PDFProcessorException

Parameters

Return Values

N/A.

Remarks

This function can be used in conjunction with RemoveAttachedFiles to have all existing attachments replaced with a list of new attachments.

Example Usage (VB, ASP)

Set oProcessor = CreateObject("easyPDF.PDFProcessor.8")
 
Dim AttachFileNames(0 To 2) As String
AttachFileNames(0) = "C:\test\attachment0001.pdf"
AttachFileNames(1) = "C:\test\attachment0002.pdf"
AttachFileNames(2) = "C:\test\attachment0003.pdf"
Dim Descriptions(0 To 2) As String
Descriptions(0) = "1st attachment"
Descriptions(1) = "2nd attachment"
Descriptions(2) = "3rd attachment"
oProcessor.AttachFilesBatch "C:\test\input.pdf", _
                      "C:\test\output.pdf", _
                      AttachFileNames, _
                      Descriptions

Example Usage (C#)

Set oProcessor = CreateObject("easyPDF.PDFProcessor.8")
 
oProcessor.AttachFilesBatch(@"C:\test\input.pdf",
                      @"C:\test\output.pdf",
                      new string[] { @"c:\test\attachment0001.jpg", @"c:\test\attachment0002.doc", @"c:\test\attachment0003.pdf" },
                      null); // optional parameters omitted