PHPackages                             webgriffe/pdftotext-bundle - 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. webgriffe/pdftotext-bundle

ActiveSymfony-bundle[PDF &amp; Document Generation](/categories/documents)

webgriffe/pdftotext-bundle
==========================

This bundle integrates Symfony2 with pdftotext binary command.

1.1.0(9y ago)330.1k3MITPHPPHP &gt;=5.3.0

Since Jul 6Pushed 9y ago3 watchersCompare

[ Source](https://github.com/webgriffe/pdftotext-bundle)[ Packagist](https://packagist.org/packages/webgriffe/pdftotext-bundle)[ RSS](/packages/webgriffe-pdftotext-bundle/feed)WikiDiscussions master Synced today

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

PDF to Text Symfony2 Bundle
===========================

[](#pdf-to-text-symfony2-bundle)

This Symfony2 bundle allows you to convert an input PDF file into plain text.

Conversion is made through `pdftotext` command-line utilty (). `pdftotext` is part of [Xpdf](http://www.foolabs.com/xpdf/index.html) software suite, is included in many Linux distributions and that should be available also for Mac OS X and Windows platforms.

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

[](#installation)

Install this bundle as any other Symfony2 bundle.

### Symfony &gt;= 2.1.x

[](#symfony--21x)

Add the following requirement to your `composer.json`:

```
"require": {
	…
	"webgriffe/pdftotext-bundle": "dev-master"
}

```

Install the bundle with the following command:

```
$ composer update webgriffe/pdftotext-bundle

```

Register the bundle in the `AppKernel`:

```
public function registerBundles()
{
	…
	new Webgriffe\PdfToTextBundle\WebgriffePdfToTextBundle(),
}

```

### Symfony 2.0.x

[](#symfony-20x)

Add the following requirement in your `deps` file:

```
…
[WebgriffePdfToTextBundle]
	git=git://github.com/webgriffe/pdftotext-bundle.git
	target=bundles/Webgriffe/PdfToTextBundle

```

Install the bundle with the following command:

```
$ bin/vendors install

```

Register the bundle in the `AppKernel`:

```
public function registerBundles()
{
	…
	new Webgriffe\PdfToTextBundle\WebgriffePdfToTextBundle(),
}

```

Usage
-----

[](#usage)

Simply, you can get the `PdfToTextConverter` from DIC and get the plain text string.

```
// Acme\MyBundle\Controller\MyController

public function myAction()
{
	$pdfFile = '/path/to/file.pdf';
	$pdfToTextConverter = $this->get('webgriffe_pdf_to_text.converter');
	$pdfText = $pdfToTextConverter->convert($pdfFile);

	return new \Symfony\Component\HttpFoundation\Response($pdfText);
}

```

You can also specify the output encoding (default is `UTF-8`).

```
$pdfText = $pdfToTextConverter->convert($pdfFile, 'ISO-8859-1');

```

Specify pdftotext binary path
-----------------------------

[](#specify-pdftotext-binary-path)

You can specify the `pdftotext` binary path in your `config.yml`:

```
webgriffe_pdf_to_text:
    bin_path: /usr/local/bin/pdftotext
```

Credits
-------

[](#credits)

This bundle has been developed by [Webgriffe®](http://www.webgriffe.com). Please, report to us any bug or suggestion by GitHub issues.

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity31

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity59

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

Total

2

Last Release

3357d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/eca104631fd7f6aff6d399ca16458c4d9814770756af0ecca22ffe2b1c5704d3?d=identicon)[mmenozzi](/maintainers/mmenozzi)

---

Top Contributors

[![mmenozzi](https://avatars.githubusercontent.com/u/1199914?v=4)](https://github.com/mmenozzi "mmenozzi (15 commits)")

---

Tags

pdfSymfony2pdftotextpdf2text

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/webgriffe-pdftotext-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/webgriffe-pdftotext-bundle/health.svg)](https://phpackages.com/packages/webgriffe-pdftotext-bundle)
```

###  Alternatives

[psliwa/pdf-bundle

This bundle integrates Symfony2 with PHPPdf library.

118413.6k](/packages/psliwa-pdf-bundle)[php-xpdf/php-xpdf

XPDF PHP, an Object Oriented library to manipulate XPDF

38227.4k2](/packages/php-xpdf-php-xpdf)[alchemy/ghostscript

Ghostscript PDF, a library to handle PDF through ghostscript

31321.1k3](/packages/alchemy-ghostscript)[wrseward/pdf-parser

PHP library to parse text from PDF files

185.6k](/packages/wrseward-pdf-parser)

PHPackages © 2026

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