PHPackages                             mamura/pdf-combine - 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. mamura/pdf-combine

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

mamura/pdf-combine
==================

Package for combining PDF files in PHP

0.1.0(3mo ago)00MITPHPPHP ^8.2

Since Apr 22Pushed 3mo agoCompare

[ Source](https://github.com/mamura/PdfCombine)[ Packagist](https://packagist.org/packages/mamura/pdf-combine)[ RSS](/packages/mamura-pdf-combine/feed)WikiDiscussions master Synced 3w ago

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

PdfCombine
==========

[](#pdfcombine)

Combine PDF files in PHP and Laravel with optional page numbering.

---

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

[](#installation)

```
composer require mamura/pdf-combine
```

---

Basic Usage (PHP)
-----------------

[](#basic-usage-php)

```
use Mamura\PdfCombine\DTO\CombinePdfData;
use Mamura\PdfCombine\Services\CombineDocuments;
use Mamura\PdfCombine\Services\Drivers\FpdiPdfCombiner;

$service = new CombineDocuments(new FpdiPdfCombiner());

$output = $service->handle(
    new CombinePdfData(
        files: [
            '/path/one.pdf',
            '/path/two.pdf',
        ],
        outputPath: '/path/merged.pdf',
        addPageNumbers: true
    )
);

echo $output;
```

---

Laravel Usage
-------------

[](#laravel-usage)

This package supports Laravel auto-discovery.

```
use Mamura\PdfCombine\DTO\CombinePdfData;
use Mamura\PdfCombine\Services\CombineDocuments;

$path = app(CombineDocuments::class)->handle(
    new CombinePdfData(
        files: [
            storage_path('app/a.pdf'),
            storage_path('app/b.pdf'),
        ],
        addPageNumbers: true
    )
);

return response()->json([
    'file' => $path,
]);
```

---

CombinePdfData
--------------

[](#combinepdfdata)

FieldTypeDescriptionfilesarrayList of PDF file pathsoutputPath?stringOutput file path (optional)addPageNumbersboolAdd page numbers to the final PDF### Notes

[](#notes)

- `files` must contain valid paths to readable PDF files.
- If `outputPath` is not provided, a temporary file will be generated automatically.
- Page numbers are rendered at the bottom center of each page when enabled.

---

Exceptions
----------

[](#exceptions)

The package may throw:

- `Mamura\PdfCombine\Exceptions\FileNotFoundException`
- `Mamura\PdfCombine\Exceptions\InvalidPdfException`
- `Mamura\PdfCombine\Exceptions\PdfCombineException`

Example:

```
try {
    $service->handle($data);
} catch (\Mamura\PdfCombine\Exceptions\PdfCombineException $e) {
    // handle error
}
```

---

Testing
-------

[](#testing)

Run tests with:

```
vendor/bin/phpunit
```

---

Current Limitations
-------------------

[](#current-limitations)

- Supports only local PDF files
- Uses FPDI as the current driver
- Does not support remote files or cloud storage (S3, etc.)
- Does not perform OCR or PDF validation beyond basic checks

---

Roadmap
-------

[](#roadmap)

- Configurable page number position
- Custom font support
- Multiple drivers (external APIs, fallback strategies)
- Stream output support (without saving to disk)

---

License
-------

[](#license)

MIT

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance82

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity36

Early-stage or recently created project

 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

94d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/236094?v=4)[Mamura](/maintainers/mamura)[@mamura](https://github.com/mamura)

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mamura-pdf-combine/health.svg)

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

###  Alternatives

[mpdf/mpdf

PHP library generating PDF files from UTF-8 encoded HTML

4.7k83.4M582](/packages/mpdf-mpdf)[horstoeko/zugferd

A library for creating and reading european electronic invoices

4295.8M31](/packages/horstoeko-zugferd)[myparcelnl/sdk

This package is designed to send and receive data from MyParcel by means of an API.

31523.5k26](/packages/myparcelnl-sdk)[atgp/factur-x

PHP library to manage your Factur-X / ZUGFeRD 2.0 PDF invoices files

153915.3k4](/packages/atgp-factur-x)[webklex/laravel-pdfmerger

Generic PDF merger for Laravel

1433.1M2](/packages/webklex-laravel-pdfmerger)[jurosh/pdf-merge

PHP PDF Merger

1552.4M6](/packages/jurosh-pdf-merge)

PHPackages © 2026

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