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.7k↑87%1[1 issues](https://github.com/langleyfoxall/pdf-stitcher/issues)LGPL-3.0-onlyPHPPHP &gt;=7.1

Since Aug 15Pushed 3y ago1 watchersCompare

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

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

26

—

LowBetter than 40% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

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

###  Release Activity

Cadence

Every ~273 days

Recently: every ~12 days

Total

6

Last Release

1190d ago

### Community

Maintainers

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

---

Top Contributors

[![jameswilddev](https://avatars.githubusercontent.com/u/3138458?v=4)](https://github.com/jameswilddev "jameswilddev (13 commits)")[![Jord-JD](https://avatars.githubusercontent.com/u/650645?v=4)](https://github.com/Jord-JD "Jord-JD (2 commits)")[![lfnicklangley](https://avatars.githubusercontent.com/u/10709152?v=4)](https://github.com/lfnicklangley "lfnicklangley (1 commits)")

---

Tags

ghostscriptpdfpdf-generationphp-library

### 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

[rodenastyle/stream-parser

PHP Multiformat Streaming Parser

442206.4k2](/packages/rodenastyle-stream-parser)[cybermonde/odtphp

ODT document generator

49123.4k1](/packages/cybermonde-odtphp)[akeneo-labs/excel-connector-bundle

Akeneo PIM Excel connector bundle

166.4k](/packages/akeneo-labs-excel-connector-bundle)

PHPackages © 2026

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