PHPackages                             karriere/pdf-merge - 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. karriere/pdf-merge

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

karriere/pdf-merge
==================

A wrapper for the TCPDF class that provides an elegant API for merging PDFs

v3.4.0(7mo ago)27692.2k↓19.5%11[3 issues](https://github.com/karriereat/pdf-merge/issues)[1 PRs](https://github.com/karriereat/pdf-merge/pulls)1Apache-2.0PHPPHP 8.3.\* | 8.4.\* | 8.5.\*CI passing

Since Mar 30Pushed 7mo ago2 watchersCompare

[ Source](https://github.com/karriereat/pdf-merge)[ Packagist](https://packagist.org/packages/karriere/pdf-merge)[ RSS](/packages/karriere-pdf-merge/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (10)Dependencies (4)Versions (16)Used By (1)

[![](https://raw.githubusercontent.com/karriereat/.github/main/profile/logo.svg)](https://www.karriere.at/) [![](https://github.com/karriereat/pdf-merge/workflows/CI/badge.svg)](https://github.com/karriereat/pdf-merge/workflows/CI/badge.svg)[![Packagist Downloads](https://camo.githubusercontent.com/b7f765cac43910812b742f52c9b0d8d91b759d0e635b9713fc0e96f76b2f8bc3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6b617272696572652f7064662d6d657267652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/karriere/pdf-merge)

Pdf Merge Solution for PHP
==========================

[](#pdf-merge-solution-for-php)

This package is a wrapper for the `TCPDF` class that provides an elegant API for merging PDF files.

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

[](#installation)

You can install the package via composer:

```
composer require karriere/pdf-merge
```

Usage
-----

[](#usage)

```
use Karriere\PdfMerge\PdfMerge;

$pdfMerge = new PdfMerge();

$pdfMerge->add('/path/to/file1.pdf');
$pdfMerge->add('/path/to/file2.pdf');

$pdfMerge->merge('/path/to/output.pdf');
```

Please note, that the `merge()`-method will throw a `NoFilesDefinedException` if no files where added.

### Check for file existence

[](#check-for-file-existence)

You can check if a file was already added for merging by calling:

```
$pdfMerge->contains('/path/to/file.pdf');
```

### Configuring header and footer

[](#configuring-header-and-footer)

You can also configure the header of footer of all pages like this:

```
use Karriere\PdfMerge\PdfMerge;

$pdfMerge = new PdfMerge(
        new HeaderConfig(
            imagePath: 'header_logo.png',
            logoWidthMM: 20,
            title: 'Header',
            text: 'This is a header text',
            textColor: new RGB(200, 200, 200),
            lineColor: new RGB(0, 0, 255),
        ),
        new FooterConfig(
            textColor: new RGB(100, 100, 100),
            lineColor: new RGB(255, 0, 0),
            margin: 20,
        ),
    );
```

All config properties have default values, so you don't have to pass them all.

License
-------

[](#license)

Apache License 2.0 Please see [LICENSE](LICENSE) for more information.

###  Health Score

58

—

FairBetter than 98% of packages

Maintenance61

Regular maintenance activity

Popularity50

Moderate usage in the ecosystem

Community22

Small or concentrated contributor base

Maturity82

Battle-tested with a long release history

 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

Every ~171 days

Recently: every ~163 days

Total

13

Last Release

225d ago

Major Versions

v1.3.0 → v2.0.02022-08-17

v2.1.0 → v3.0.02023-03-01

PHP version history (7 changes)v1.0.0PHP &gt;=7.2

v1.3.0PHP ^7.2 | ^8.0

v2.0.0PHP ^7.4 | ^8.0

v3.0.0PHP 8.0.\* | 8.1.\* | 8.2.\*

v3.1.0PHP 8.0.\* | 8.1.\* | 8.2.\* | 8.3.\*

v3.2.0PHP 8.1.\* | 8.2.\* | 8.3.\* | 8.4.\*

v3.4.0PHP 8.3.\* | 8.4.\* | 8.5.\*

### Community

Maintainers

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

![](https://avatars.githubusercontent.com/u/24518541?v=4)[karriere-at-dev](/maintainers/karriere-at-dev)[@karriere-at-dev](https://github.com/karriere-at-dev)

---

Top Contributors

[![Chris53897](https://avatars.githubusercontent.com/u/7104259?v=4)](https://github.com/Chris53897 "Chris53897 (4 commits)")[![fetzi](https://avatars.githubusercontent.com/u/3509426?v=4)](https://github.com/fetzi "fetzi (3 commits)")[![Chris8934](https://avatars.githubusercontent.com/u/44963939?v=4)](https://github.com/Chris8934 "Chris8934 (2 commits)")[![lentex](https://avatars.githubusercontent.com/u/9319316?v=4)](https://github.com/lentex "lentex (2 commits)")[![cikabole](https://avatars.githubusercontent.com/u/688246?v=4)](https://github.com/cikabole "cikabole (1 commits)")[![jaylinski](https://avatars.githubusercontent.com/u/1668766?v=4)](https://github.com/jaylinski "jaylinski (1 commits)")[![wimpichjo](https://avatars.githubusercontent.com/u/203976988?v=4)](https://github.com/wimpichjo "wimpichjo (1 commits)")

---

Tags

fpdf-librarypdfphpwrapperpdfmerge

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/karriere-pdf-merge/health.svg)

```
[![Health](https://phpackages.com/badges/karriere-pdf-merge/health.svg)](https://phpackages.com/packages/karriere-pdf-merge)
```

###  Alternatives

[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.7k38.9k](/packages/matomo-matomo)[iio/libmergepdf

Library for merging multiple PDFs

40814.5M20](/packages/iio-libmergepdf)[elibyy/tcpdf-laravel

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

3632.9M8](/packages/elibyy-tcpdf-laravel)[jurosh/pdf-merge

PHP PDF Merger

1552.4M5](/packages/jurosh-pdf-merge)[bithost-gmbh/pdfviewhelpers

This is a TYPO3 CMS extension that provides various Fluid ViewHelpers to generate PDF documents.

45262.7k3](/packages/bithost-gmbh-pdfviewhelpers)[aspose-cloud/aspose-words-cloud

Open, generate, edit, split, merge, compare and convert Word documents. Integrate Cloud API into your solutions to manipulate documents. Convert PDF to Word (DOC, DOCX, ODT, RTF and HTML) and in the opposite direction.

33175.7k](/packages/aspose-cloud-aspose-words-cloud)

PHPackages © 2026

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