PHPackages                             andreaventuri/pdfmerger - 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. andreaventuri/pdfmerger

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

andreaventuri/pdfmerger
=======================

PDFMerger for PHP (version 5.3 to 7.2)

14762PHP

Since Mar 19Pushed 8y ago2 watchersCompare

[ Source](https://github.com/andreaventuri/PDFMerger)[ Packagist](https://packagist.org/packages/andreaventuri/pdfmerger)[ RSS](/packages/andreaventuri-pdfmerger/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

PDFMerger for PHP (version 5.3 to 7.2)
======================================

[](#pdfmerger-for-php-version-53-to-72)

PDFMerger forked from [myokyawhtun/PDFMerger](https://github.com/myokyawhtun/PDFMerger)

New features:

- PSR-4 support
- Namespaces support
- Possibility to print header and/or footer on the merged pdf

PHP 7 Compatible
----------------

[](#php-7-compatible)

I tested with PHP 7.2.3 on my develpment machine and it works well.

Support of PDF 1.5 and PDF 1.6
------------------------------

[](#support-of-pdf-15-and-pdf-16)

FPDF and FPDI libraries replaced by TCPDF with TCPDI extension and parser.

### Example Usage

[](#example-usage)

```
$loader = require __DIR__ . '/../vendor/autoload.php';

$pdf = new andreaventuri\PdfMerger\PdfMerger;

$pdf->addPDF('samplepdfs/one.pdf', '1, 3, 4');
$pdf->addPDF('samplepdfs/two.pdf', '1-2');
$pdf->addPDF('samplepdfs/three.pdf');

$pdf->merge('file', 'samplepdfs/TEST2.pdf'); // generate the file

$pdf->merge('download', 'samplepdfs/test.pdf'); // force download

// REPLACE 'file' WITH 'browser', 'download', 'string', or 'file' for output options
```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

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

### Community

Maintainers

![](https://www.gravatar.com/avatar/35dee9b2b240b5682342a5b5f0a862e4e76798a47e93cebb80ac9e674b4b5406?d=identicon)[andreaventuri](/maintainers/andreaventuri)

---

Top Contributors

[![myokyawhtun](https://avatars.githubusercontent.com/u/295096?v=4)](https://github.com/myokyawhtun "myokyawhtun (18 commits)")[![andreaventuri](https://avatars.githubusercontent.com/u/1456430?v=4)](https://github.com/andreaventuri "andreaventuri (3 commits)")[![Kadmillos](https://avatars.githubusercontent.com/u/2362200?v=4)](https://github.com/Kadmillos "Kadmillos (1 commits)")[![notriddle](https://avatars.githubusercontent.com/u/1593513?v=4)](https://github.com/notriddle "notriddle (1 commits)")

### Embed Badge

![Health badge](/badges/andreaventuri-pdfmerger/health.svg)

```
[![Health](https://phpackages.com/badges/andreaventuri-pdfmerger/health.svg)](https://phpackages.com/packages/andreaventuri-pdfmerger)
```

###  Alternatives

[phpoffice/phpspreadsheet

PHPSpreadsheet - Read, Create and Write Spreadsheet documents in PHP - Spreadsheet engine

13.9k293.5M1.2k](/packages/phpoffice-phpspreadsheet)[spatie/browsershot

Convert a webpage to an image or pdf using headless Chrome

5.2k32.1M100](/packages/spatie-browsershot)[smalot/pdfparser

Pdf parser library. Can read and extract information from pdf file.

2.7k34.5M216](/packages/smalot-pdfparser)[barryvdh/laravel-snappy

Snappy PDF/Image for Laravel

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

PHP Library to read and write spreadsheet files (CSV, XLSX and ODS), in a fast and scalable way

1.1k57.6M128](/packages/openspout-openspout)[keboola/csv

Keboola CSV reader and writer

1451.8M21](/packages/keboola-csv)

PHPackages © 2026

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