/pdf-merge

This package is a wrapper for the TCPDF class that provides an elegant API for merging PDF files.

Primary LanguagePHP

   

Pdf Merge Solution for PHP

This package is a wrapper for the TCPDF class that provides an elegant API for merging PDF files.

Installation

You can install the package via composer:

composer require karriere/pdf-merge

Usage

$pdfMerge = new PdfMerge();

$pdfMerge->add('/path/to/file1.pdf');
$pdfMerge->add('/path/to/file2.pdf');

$pdfMerge->merge('/path/to/output.pdf');

Please note, that the merge method will throw an NoFilesDefinedException if no files where added.

Check for file existence

You can check if a file was already added for merging by calling:

$pdfMerge->contains('/path/to/file.pdf');

License

Apache License 2.0 Please see LICENSE for more information.