PHPackages                             yaroslavpopovic/laravel-pdf-merger - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [PDF &amp; Document Generation](/categories/documents)
4. /
5. yaroslavpopovic/laravel-pdf-merger

ActiveLibrary[PDF &amp; Document Generation](/categories/documents)

yaroslavpopovic/laravel-pdf-merger
==================================

Laravel PDF Merger based on TCPDF — fork of softplaceweb/laravel-10-pdf-merger with Laravel 11/12/13 support.

v2.0.0(1mo ago)013MITPHPPHP ^8.2

Since May 10Pushed 1mo agoCompare

[ Source](https://github.com/yaroslavpopovic/laravel-pdf-merger)[ Packagist](https://packagist.org/packages/yaroslavpopovic/laravel-pdf-merger)[ RSS](/packages/yaroslavpopovic-laravel-pdf-merger/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (7)Versions (2)Used By (0)

Laravel PDF Merger based TCPDF
==============================

[](#laravel-pdf-merger-based-tcpdf)

[![Latest Stable Version](https://camo.githubusercontent.com/96add1cf64b078cbac7ef7e6966324da33429ace265d9b3a6bd6014bf35a1b0b/68747470733a2f2f706f7365722e707567782e6f72672f7961726f736c6176706f706f7669632f6c61726176656c2d7064662d6d65726765722f762f737461626c65)](https://packagist.org/packages/yaroslavpopovic/laravel-pdf-merger) [![Total Downloads](https://camo.githubusercontent.com/85edb6fa428ded89efca80a9423dc0f35fb146c238c1ba64c3e2054bf8c7db59/68747470733a2f2f706f7365722e707567782e6f72672f7961726f736c6176706f706f7669632f6c61726176656c2d7064662d6d65726765722f646f776e6c6f616473)](https://packagist.org/packages/yaroslavpopovic/laravel-pdf-merger) [![License](https://camo.githubusercontent.com/0f575efe02ac0df770ce2ed4e607740fad232cd2b7adfb2852feeb7f889d1cef/68747470733a2f2f706f7365722e707567782e6f72672f7961726f736c6176706f706f7669632f6c61726176656c2d7064662d6d65726765722f6c6963656e7365)](https://packagist.org/packages/yaroslavpopovic/laravel-pdf-merger)

> Fork of [`softplaceweb/laravel-10-pdf-merger`](https://github.com/SoftPlaceWeb/laravel-10-pdf-merger) with support for Laravel 11, 12 and 13.

A simple [Laravel](http://www.laravel.com) service provider with some basic configuration for including the [TCPDF library](http://www.tcpdf.org/) to allow you to merge PDF's in your Laravel application.

Compatibility from 1.3 to 1.7 versions, if attempt to merge version greater than 1.4 it convert through Ghostscript.

The final result is a merged pdf file v 1.7

Requirements
------------

[](#requirements)

- PHP 8.2+
- Laravel 11, 12 or 13
- Ghostscript (`gs` command on Linux)

Installation
------------

[](#installation)

```
composer require yaroslavpopovic/laravel-pdf-merger

```

for lumen, you should add the following lines:

```
$app->register(Softplaceweb\PdfMerger\PdfMergerServiceProvider::class);
class_alias(Softplaceweb\PdfMerger\Facades\TCPDF::class, 'PDF');
```

That's it! You're good to go.

Here is a little example:

```
use Softplaceweb\PdfMerger\Facades\PdfMerger;

PdfMerger::addPDF('path/to/pdf1.pdf', 1)
->addPDF('path/to/pdf2.pdf', 'all')
->merge()
->save('new_file_name.pdf', 'browser');
```

or sending pdf's as array ...

```
use Softplaceweb\PdfMerger\Facades\PdfMerger;

PdfMerger::addPDF([
    [
        'filePath' => 'path/to/pdf1.pdf',
        'pages'    => 1,
    ],
    [
        'filePath' => 'path/to/pdf2.pdf',
    ],
])
->merge()
->save('new_file_name.pdf', 'browser');
```

You can extend functionality for this class and for a list of all available function take a look at the [TCPDF Documentation](https://tcpdf.org/docs/srcdoc/TCPDF/)

Configuration
-------------

[](#configuration)

Laravel Pdf Merger comes with some basic configuration. If you want to override the defaults, you can publish the config, like so:

```
php artisan vendor:publish --provider="Softplaceweb\PdfMerger\PdfMergerServiceProvider"

```

Now access `config/pdf-merger.php` to customize.

- use\_original\_header is to used the original `Header()` from TCPDF.
    - Please note that `PdfMerger::setHeaderCallback(function($pdf){})` overrides this settings.
- use\_original\_footer is to used the original `Footer()` from TCPDF.
    - Please note that `PdfMerger::setFooterCallback(function($pdf){})` overrides this settings.

Credits
-------

[](#credits)

- [oriceon/laravel-pdf-merger](https://github.com/oriceon/laravel-pdf-merger)
- [DALTCORE/lara-pdf-merger](https://github.com/DALTCORE/lara-pdf-merger)
- [elibyy/tcpdf-laravel](https://github.com/elibyy/tcpdf-laravel)
- [anton-am/pdf-version-converter](https://github.com/Anton-Am/pdf-version-converter)

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance94

Actively maintained with recent releases

Popularity8

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

30d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c6419027a09177e5ec17e24fca74d7cb7e6e2ab94bb65fccc078f2777e2731a7?d=identicon)[yaroslavpopovic](/maintainers/yaroslavpopovic)

---

Top Contributors

[![yaroslavpopovic](https://avatars.githubusercontent.com/u/12303752?v=4)](https://github.com/yaroslavpopovic "yaroslavpopovic (7 commits)")[![SoftPlaceWeb-Dev](https://avatars.githubusercontent.com/u/107917935?v=4)](https://github.com/SoftPlaceWeb-Dev "SoftPlaceWeb-Dev (6 commits)")[![oriceon](https://avatars.githubusercontent.com/u/358823?v=4)](https://github.com/oriceon "oriceon (3 commits)")[![vincenzoSoft](https://avatars.githubusercontent.com/u/108322014?v=4)](https://github.com/vincenzoSoft "vincenzoSoft (2 commits)")

---

Tags

laravelpdfTCPDFmerger

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/yaroslavpopovic-laravel-pdf-merger/health.svg)

```
[![Health](https://phpackages.com/badges/yaroslavpopovic-laravel-pdf-merger/health.svg)](https://phpackages.com/packages/yaroslavpopovic-laravel-pdf-merger)
```

###  Alternatives

[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.6k38.2k](/packages/matomo-matomo)[elibyy/tcpdf-laravel

tcpdf support for Laravel 6, 7, 8, 9, 10, 11

3632.9M7](/packages/elibyy-tcpdf-laravel)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

744284.3k34](/packages/civicrm-civicrm-core)[tempest/framework

The PHP framework that gets out of your way.

2.2k31.1k11](/packages/tempest-framework)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.4M506](/packages/shopware-core)[webklex/laravel-pdfmerger

Generic PDF merger for Laravel

1422.9M2](/packages/webklex-laravel-pdfmerger)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
