mergePdf

mergePdf

ADVANCED / PREMIUM TRIAL

Merges two or more PDF documents.

Description
public mergePdf (array $documentArray, string $finalDocument, [array $options])

This method allows the full merging of PDF documents.

Parameters

documentArray

Paths array of the PDF documents to merge.

finalDocument

The destination path of the merged file.

options

The possible keys and values are:

key Type Description
annotations bool Import annotations (links, comments and others). Default as false.
useFixedAnnotationPositions bool Force annotation page link IDs. Useful when using PDF readers that don't detect all PDF contents automatically. Default as false.
Exceptions

File doesn't exist.

Missing array.

Code samples

Example #1:

The resulting output looks like: