Skip to content

pauljohnston/php-pdf-merge

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PDF Merge for PHP

PDF Merge library for PHP.

Install with composer:

composer require pauljohnston/php-pdf-merge

Should add dependency:

"pauljohnston/php-pdf-merge": "^2.3"

Highlights

Pdf merging with modes portrait/landscape.

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

Usage

// Autoload composer classes...

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

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

// 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 :)

About

PDF Merge library for PHP

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%