PDFMerger Class Method

In this section, the PDFMerger class method is presented.

Syntax

MergePDFs(PDFFileArray, PDFOutputFile, Error)

Description

Use the MergePDFs method to merge the specified PDF files into a single output file.

The order of the files specified in the array are the order in which the files are merged.

Parameters

Field or Control

Definition

PDFFileArray

Specify an already instantiated and populated array of string containing the names of the PDF files that you want to merge together.

PDFOutputFile

Specify the full path name of the file you want populated with the merged PDF file.

Forward or back slashes are used in the path according to the operating system of the application server or process scheduler server. That is, on Unix servers, the directory separator is a forward slash, while a Windows server returns a path with back slashes.

Error

If any errors occur during processing, this parameter is populated with the text of the error message after processing.

Returns

A Boolean: true if the method completed successfully, false otherwise. If this method returns false, the Error parameter is populated with the text of the error message that occurred.

Example

Local PSXP_ENGINE:PDFMerger &oMerger;

&sErr = "";
&asNames = CreateArray(&sPdfFile1);
&asNames.Push(&sPdfFile2);
&bResult = &oMerger.mergePDFs(&asNames, &sOutputPdfFile, &sErr);