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

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

it-devgroup/laravel-pdf-merger
==============================

Package for Laravel that merges multiple PDFs into one.

1.0.1(5y ago)027MITPHP

Since Apr 20Pushed 5y ago1 watchersCompare

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

READMEChangelog (1)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)

- Works with `PHP 7.4`
- Works with `Laravel 8`

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

[](#installation)

```
  composer require it-devgroup/laravel-pdf-merger
```

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

[](#configuration)

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

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

'aliases' => [
   ...
   'PDFMerger' => ItDevgroup\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. Also, note that this package requires Ghostscript installed on the server in order to functiona properly with PDF versions 1.5+. [Install Guide](https://www.ghostscript.com/doc/9.20/Install.htm)

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/it-devgroup/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'));
```

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 87% 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

1900d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/35729675?v=4)[it-devgroup](/maintainers/it-devgroup)[@it-devgroup](https://github.com/it-devgroup)

---

Top Contributors

[![GrofGraf](https://avatars.githubusercontent.com/u/16609463?v=4)](https://github.com/GrofGraf "GrofGraf (20 commits)")[![drfraker](https://avatars.githubusercontent.com/u/1279323?v=4)](https://github.com/drfraker "drfraker (1 commits)")[![it-devgroup](https://avatars.githubusercontent.com/u/35729675?v=4)](https://github.com/it-devgroup "it-devgroup (1 commits)")[![synapsewebtechadmin](https://avatars.githubusercontent.com/u/7449947?v=4)](https://github.com/synapsewebtechadmin "synapsewebtechadmin (1 commits)")

---

Tags

laravelpdfmergerpdfmergerpdf-mergerit-devgroup

### Embed Badge

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

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

###  Alternatives

[grofgraf/laravel-pdf-merger

Package for Laravel that merges multiple PDFs into one.

30557.8k](/packages/grofgraf-laravel-pdf-merger)[webklex/laravel-pdfmerger

Generic PDF merger for Laravel

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

PHPackages © 2026

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