jurosh/pdf-merge

PHP PDF Merger

Maintainers

👁 jurosh

Package info

github.com/jurosh/php-pdf-merge

pkg:composer/jurosh/pdf-merge

Statistics

Installs: 2 348 892

Dependents: 4

Suggesters: 0

Stars: 151

Open Issues: 13

2.1.0 2021-03-28 19:57 UTC

Requires

Requires (Dev)

None

Suggests

None

Provides

None

Conflicts

None

Replaces

None

MIT 89ba3446c9f38c573e3b8bf577d2f22993494130

pdfmerge

This package is not auto-updated.

Last update: 2026-06-15 20:00:47 UTC


README

PDF Merge library for PHP.

Install with composer:

composer require jurosh/pdf-merge

Should add dependency:

"jurosh/pdf-merge": "^2.0"

Highlights

Pdf merging with modes portrait/landscape.

Tested in Laravel4 & Laravel5 framework (but still can be used without any framework as standalone utility).

Usage

// Autoload composer classses...

// and now we can use library
$pdf = new \Jurosh\PDFMerge\PDFMerger;

// add as many pdfs as you want
$pdf->addPDF('path/to/source/file.pdf', 'all', 'vertical')
 ->addPDF('path/to/source/file1.pdf', 'all')
 ->addPDF('path/to/source/file2.pdf', 'all', 'horizontal');

// call merge, output format `file`
$pdf->merge('file', 'path/to/export/dir/file.pdf');

That's it!

Enjoy and leave star if you like it :)