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)329.6k3MITPHPPHP &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 1mo ago

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

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity30

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

3309d 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

[tecnickcom/tcpdf

TCPDF is a PHP class for generating PDF documents and barcodes.

4.5k101.8M473](/packages/tecnickcom-tcpdf)[mpdf/mpdf

PHP library generating PDF files from UTF-8 encoded HTML

4.7k77.1M493](/packages/mpdf-mpdf)[knplabs/knp-snappy

PHP library allowing thumbnail, snapshot or PDF generation from a url or a html page. Wrapper for wkhtmltopdf/wkhtmltoimage.

4.5k68.3M56](/packages/knplabs-knp-snappy)[psliwa/pdf-bundle

This bundle integrates Symfony2 with PHPPdf library.

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

XPDF PHP, an Object Oriented library to manipulate XPDF

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

Ghostscript PDF, a library to handle PDF through ghostscript

30316.5k3](/packages/alchemy-ghostscript)

PHPackages © 2026

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