PHPackages                             akemys/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. akemys/laravel-pdf-merger

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

akemys/laravel-pdf-merger
=========================

Package for Laravel that merges multiple PDFs into one.

1.0.2(6y ago)0123↓20%MITPHP

Since May 15Pushed 6y agoCompare

[ Source](https://github.com/akemys/laravel-pdf-merger)[ Packagist](https://packagist.org/packages/akemys/laravel-pdf-merger)[ RSS](/packages/akemys-laravel-pdf-merger/feed)WikiDiscussions master Synced yesterday

READMEChangelog (3)Dependencies (2)Versions (2)Used By (0)

Laravel PDF Merger
==================

[](#laravel-pdf-merger)

PDF merger for Laravel inspired by another package, created for personal use. Tested with Laravel 5.6.

Advantages
----------

[](#advantages)

- Also works with PDF versions above `1.4`
- Works with `PHP 7`

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

[](#installation)

```
 $ composer require grofgraf/laravel-pdf-merger
```

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

[](#configuration)

Make the following changes to the main configuration file located at `config/app.php`

```
'providers' => [
   ...
   GrofGraf\LaravelPDFMerger\Providers\PDFMergerServiceProvider::class
],

'aliases' => [
   ...
   'PDFMerger' => GrofGraf\LaravelPDFMerger\Facades\PDFMergerFacade::class
]
```

> When merging PDFs versions above 1.4 or PDF strings, a temporary PDF will be created during the process and stored in `storage/tmp` directory, therefore you may need to create it beforehand.

Usage
-----

[](#usage)

You can add PDFs for merging, by specifying a file path of PDF with `addPathToPDF` method, or adding PDF file as string with `addPDFString` method. The second argument of both methods is array of selected pages (`'all'` for all pages) and the third argument is PDFs orientation (portrait or landscape).

```
$merger->addPathToPDF('/path/to/pdf', 'all', 'P');
$merger->addPDFString(file_get_contents('path/to/pdf'), ['1', '2'], 'L')
```

You can set a merged PDF name by using `setFileName` method.

```
$merger->setFileName('merger.pdf');
```

In the end, finnish process with `merge` or `duplexMerge` method and use one of the output options for the merged PDF. The difference bwetween two methods is, that `duplexMerge` adds blank page after each merged PDF, if it has odd number of pages.

Available output options are:

- `inline()`
- `download()`
- `string()`
- `save('path/to/merged.pdf')`

```
$merger->merge();
$merger->inline();
```

Example usage

```
$merger = \PDFMerger::init();
$merger->addPathToPDF(base_path('/vendor/grofgraf/laravel-pdf-merger/examples/one.pdf'), [2], 'P');
$merger->addPDFString(file_get_contents(base_path('/vendor/grofgraf/laravel-pdf-merger/examples/two.pdf')), 'all', 'L');
$merger->merge();
$merger->save(base_path('/public/pdfs/merged.pdf'));
```

Authors
-------

[](#authors)

- [GrofGraf](https://github.com/GrofGraf)

Credits
-------

[](#credits)

- **Webklex** [LaravelPDFMerger](https://github.com/Webklex/laravel-pdfmerger)

License
-------

[](#license)

The MIT License (MIT)

Copyright (c) 2017 GrofGraf

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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

2554d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2c2f9f89d07da3fe0f8445b22433012fd07b9c24340b5c127c507c75696c11f3?d=identicon)[akemys](/maintainers/akemys)

---

Top Contributors

[![akemys](https://avatars.githubusercontent.com/u/26094761?v=4)](https://github.com/akemys "akemys (4 commits)")

---

Tags

laravelpdfmergerpdfmergergrofgrafpdf-merger

### Embed Badge

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

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

###  Alternatives

[barryvdh/laravel-dompdf

A DOMPDF Wrapper for Laravel

7.3k87.6M278](/packages/barryvdh-laravel-dompdf)[grofgraf/laravel-pdf-merger

Package for Laravel that merges multiple PDFs into one.

29548.6k](/packages/grofgraf-laravel-pdf-merger)[barryvdh/laravel-snappy

Snappy PDF/Image for Laravel

2.8k24.8M48](/packages/barryvdh-laravel-snappy)[webklex/laravel-pdfmerger

Generic PDF merger for Laravel

1422.6M2](/packages/webklex-laravel-pdfmerger)[elibyy/tcpdf-laravel

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

3542.7M5](/packages/elibyy-tcpdf-laravel)

PHPackages © 2026

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