koerel / pdfunite
A php wrapper for pdfunite
Installs: 87 230
Dependents: 0
Suggesters: 0
Security: 0
Stars: 5
Watchers: 1
Forks: 1
Open Issues: 0
Requires
- php: >=7.1
Requires (Dev)
- phpunit/phpunit: ~6.0
This package is not auto-updated.
Last update: 2025-04-27 06:07:58 UTC
README
pdfunite is part of the poppler PDF library. It is a command-line tool use to join PDF files. This library provides a PHP wrapper around pdfunite.
Installation
run composer require koerel/pdfunite
Usage
The join method accepts any number of input files, the last parameter is the output file.
$unite = new Koerel\PdfUnite\PdfUnite();
$unite->join('file1.pdf', 'file2.pdf', 'output.pdf');
If the pdfunite-binary is not in the $PATH you can pass it's path to the constructor.
$unite = new Koerel\PdfUnite\PdfUnite('path/to/pdfunite');
$unite->join('file1.pdf', 'file2.pdf', 'output.pdf');
To get the result as a string you can chain the output() method
$unite = new Koerel\PdfUnite\PdfUnite();
$pdfData = $unite->join('file1.pdf', 'file2.pdf', 'output.pdf')->output();
To download the resulting PDF, you can chain the download() method
$unite = new Koerel\PdfUnite\PdfUnite();
$unite->join('file1.pdf', 'file2.pdf', 'output.pdf')->download();