PHPackages                             langleyfoxall/pdf-stitcher - 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. langleyfoxall/pdf-stitcher

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

langleyfoxall/pdf-stitcher
==========================

Stitches together multiple PDFs

v1.3.1(3y ago)12.4k↑25%LGPL-3.0-onlyPHP &gt;=7.1

Since Aug 15Compare

[ Source](https://github.com/langleyfoxall/pdf-stitcher)[ Packagist](https://packagist.org/packages/langleyfoxall/pdf-stitcher)[ RSS](/packages/langleyfoxall-pdf-stitcher/feed)WikiDiscussions Synced today

READMEChangelog (6)DependenciesVersions (8)Used By (0)

PDF Stitcher
============

[](#pdf-stitcher)

The PDF Stitcher library allows you to easily stitch together multiple PDFs into a single file.

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

[](#installation)

To install the PDF Stitcher package, run the following Composer command.

```
composer require langleyfoxall/pdf-stitcher
```

Please note that this package requires Ghostscript (`gs`) to be installed on your server. If you are running Ubuntu, this can be installed with the following command.

```
sudo apt install ghostscript
```

Usage
-----

[](#usage)

See the following basic usage example.

```
(new PdfStitcher)
    ->addPdf('firstDocument.pdf')
    ->addPdfs(['secondDocument.pdf', 'yetAnotherDocument.pdf'])
    ->save('destinationDocument.pdf');
```

This will take in three input PDFs, stitch them together, and save out the result to `destinationDocument.pdf`. The documents will be stitched together in the order they are added.

### Where Ghostscript is in an unusual location

[](#where-ghostscript-is-in-an-unusual-location)

A path to a Ghostscript executable can be passed into the `PdfStitcher` constructor:

```
new PdfStitcher('a/path/to/a/gs/executable')
```

### Additional Ghostscript arguments

[](#additional-ghostscript-arguments)

Additional Ghostscript arguments can be passed into the `PdfStitcher` constructor:

```
new PdfStitcher(null, '-dNEWPDF=false')
```

These will NOT be escaped in any way.

### Including only specific pages from a PDF

[](#including-only-specific-pages-from-a-pdf)

You may optionally give an array of page indices when adding a PDF:

```
(new PdfStitcher)
    ->addPdf('firstDocument.pdf', [0, 2, 3, 5])
    ->save('destinationDocument.pdf');
```

Only the page numbers you list will be included.

The following will be rejected:

- Non-integer page numbers.
- Page numbers less than zero.
- Duplicate page numbers (e.g. 1, 3, 3, 5, 7).
- Misordered page numbers (e.g. 1, 5, 3, 7).

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

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 ~273 days

Recently: every ~12 days

Total

6

Last Release

1145d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c580cdf7c14898fff179cdfc1085892091d5d2f49d917873a12365af9ac77c93?d=identicon)[Jord-JD](/maintainers/Jord-JD)

### Embed Badge

![Health badge](/badges/langleyfoxall-pdf-stitcher/health.svg)

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

###  Alternatives

[tarfin-labs/easy-pdf

Makes pdf processing easy.

1719.9k](/packages/tarfin-labs-easy-pdf)

PHPackages © 2026

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