Skip to content
A FPDI PDF Wrapper for Laravel which includes the "merge" functionality
Branch: master
Clone or download
Latest commit 459f8a6 May 29, 2018
Type Name Latest commit message Commit time
Failed to load latest commit information.
src/PDFMerger Add duplex merging May 3, 2017
.gitignore Initial push Feb 17, 2017
.travis.yml Empty lines removed Feb 17, 2017 Update May 29, 2018
LICENSE Initial push Feb 17, 2017 Initial push Feb 17, 2017 Update May 4, 2017
composer.json Change FPDF package May 29, 2018
phpunit.xml.dist Initial push Feb 17, 2017

Laravel PDFMerger

Latest Version on Packagist Software License Build Status Total Downloads


Via Composer

$ composer require webklex/laravel-pdfmerger


Add the service provider to the providers array in config/app.php.

'providers' => [

'aliases' => [
    'PDFMerger' => Webklex\PDFMerger\Facades\PDFMergerFacade::class


A basic usage example:

use Webklex\PDFMerger\Facades\PDFMergerFacade as PDFMerger;

$oMerger = PDFMerger::init();

$oMerger->addPDF('/path/to/project/vendors/webklex/laravel-pdfmerger/src/PDFMerger/examples/pdf_one.pdf', [2]);
$oMerger->addPDF('/path/to/project/vendors/webklex/laravel-pdfmerger/src/PDFMerger/examples/pdf_two.pdf', 'all');


...add raw content data:

$oMerger->addString(file_get_contents('/path/to/project/vendors/webklex/laravel-pdfmerger/src/PDFMerger/examples/pdf_two.pdf'), [1]); the pages you want to merge:

$oMerger->addPDF($file, 'all');  //Add all pages
$oMerger->addPDF($file, [1]);    //Add page one only
$oMerger->addPDF($file, [2]);    //Add page two only
$oMerger->addPDF($file, [1, 3]); //Add page one and three only

...merge files together but add blank pages to support duplex printing:

$oMerger->duplexMerge(); the merged content:

$oMerger->stream(); the merged content:


..get the raw content data:

echo $oMerger->output();

...set the filename if you don't want to do it later:


Change log

Please see CHANGELOG for more information what has changed recently.


$ composer test


If you discover any security related issues, please email instead of using the issue tracker.



The MIT License (MIT). Please see License File for more information.

You can’t perform that action at this time.