PHPackages                             1tomany/pdf-pack - 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. 1tomany/pdf-pack

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

1tomany/pdf-pack
================

A simple PHP library that makes rasterizing pages and extracting text from PDFs for large language models easy

v0.7.2(1mo ago)437↓33.3%11MITPHPPHP &gt;=8.2

Since Mar 27Pushed 1mo ago2 watchersCompare

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

READMEChangelog (10)Dependencies (15)Versions (29)Used By (1)

PDF Extraction Library for PHP
==============================

[](#pdf-extraction-library-for-php)

`pdf-pack` is a simple PHP library that makes rasterizing pages and extracting text from PDFs for large language models easy. It uses a single dependency, the [Symfony Process Component](https://symfony.com/doc/current/components/process.html), to interface with the [Poppler command line tools from the xpdf library](https://poppler.freedesktop.org/).

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

[](#installation)

Install the library using Composer:

```
composer require 1tomany/pdf-pack
```

Installing Poppler
------------------

[](#installing-poppler)

Before beginning, ensure the `pdfinfo`, `pdftoppm`, and `pdftotext` binaries are installed and located in your `$PATH`.

### macOS

[](#macos)

```
brew install poppler
```

### Debian and Ubuntu

[](#debian-and-ubuntu)

```
apt-get install poppler-utils
```

Usage
-----

[](#usage)

This library has three main features:

- Read PDF metadata such as the number of pages
- Rasterize one or more pages to JPEG or PNG images
- Extract text from one or more pages

Extracted data is stored in memory and can be written to the filesystem or converted to a `data:` URI. Because extracted data is stored in memory, this library returns a `\Generator` object for each page that is extracted or rasterized.

Using the library is easy, and you have two ways to interact with it:

1. **Direct** Instantiate the `OneToMany\PdfPack\Client\Poppler\PopplerClient` class and call the methods directly. This method is easier to use, but comes with the cost that your application will be less flexible and testable.
2. **Actions** Create a container of `OneToMany\PdfPack\Contract\Client\ClientInterface` objects, and use the `OneToMany\PdfPack\Factory\ClientFactory` class to instantiate them.

**Note:** A [Symfony bundle](https://github.com/1tomany/pdf-pack-bundle) is available if you wish to integrate this library into your Symfony applications with autowiring and configuration support.

### Direct usage

[](#direct-usage)

See [`examples/direct.php`](https://github.com/1tomany/pdf-pack/blob/master/examples/direct.php).

Credits
-------

[](#credits)

- [Vic Cherubini](https://github.com/viccherubini), [1:N Labs, LLC](https://1tomany.com)

License
-------

[](#license)

The MIT License

###  Health Score

44

—

FairBetter than 92% of packages

Maintenance89

Actively maintained with recent releases

Popularity16

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 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

Every ~15 days

Recently: every ~5 days

Total

25

Last Release

55d ago

PHP version history (2 changes)v0.0.1PHP &gt;=8.4

v0.5.0PHP &gt;=8.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/60762?v=4)[Vic Cherubini](/maintainers/viccherubini)[@viccherubini](https://github.com/viccherubini)

---

Top Contributors

[![viccherubini](https://avatars.githubusercontent.com/u/60762?v=4)](https://github.com/viccherubini "viccherubini (80 commits)")

---

Tags

pdfOCRpdf-to-textpdf-to-imagepdfinfoxpdfpdf2textpopplerpdftoppmpdf2imagepdf2imgpdf2txt

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/1tomany-pdf-pack/health.svg)

```
[![Health](https://phpackages.com/badges/1tomany-pdf-pack/health.svg)](https://phpackages.com/packages/1tomany-pdf-pack)
```

###  Alternatives

[spatie/pdf-to-image

Convert a pdf to an image

1.4k15.2M64](/packages/spatie-pdf-to-image)[vaites/php-apache-tika

Apache Tika bindings for PHP: extracts text from documents and images (with OCR), metadata and more...

1171.5M2](/packages/vaites-php-apache-tika)[sensiolabs/gotenberg-bundle

A Symfony bundle that provides seamless integration with Gotenberg for generating PDFs and screenshots from various sources (HTML, Markdown, Office documents, URLs) with a clean, builder-based API.

210210.4k2](/packages/sensiolabs-gotenberg-bundle)[howtomakeaturn/pdfinfo

simple php wrapper for pdfinfo

68526.4k2](/packages/howtomakeaturn-pdfinfo)[php-xpdf/php-xpdf

XPDF PHP, an Object Oriented library to manipulate XPDF

38224.4k2](/packages/php-xpdf-php-xpdf)[padam87/rasterize-bundle

HTML to PDF Symfony bundle. Works with Puppeteer, PhantomJS, and more.

1579.4k](/packages/padam87-rasterize-bundle)

PHPackages © 2026

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