PHPackages                             falkemedia/pdf-extractor - 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. falkemedia/pdf-extractor

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

falkemedia/pdf-extractor
========================

This package automates the generation of an SQLite database that you can use to do a full-text search on a PDF.

0.0.3(5y ago)114MITPHPPHP ^7.1

Since Aug 4Pushed 5y ago2 watchersCompare

[ Source](https://github.com/falkemedia/pdf-extractor)[ Packagist](https://packagist.org/packages/falkemedia/pdf-extractor)[ Docs](https://github.com/falkemedia/pdf-extractor)[ RSS](/packages/falkemedia-pdf-extractor/feed)WikiDiscussions master Synced today

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

PDF Extractor
=============

[](#pdf-extractor)

[![Latest Version on Packagist](https://camo.githubusercontent.com/a3c40d61af8abb4fc39cfeaf26dcf6462480df0bf5530695942097c7190b34bf/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f66616c6b656d656469612f7064662d657874726163746f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/falkemedia/pdf-extractor)[![Total Downloads](https://camo.githubusercontent.com/9020e2147df6a5361baab97cf5e859b592e59cd02ad239f2f373921f49482a7e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f66616c6b656d656469612f7064662d657874726163746f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/falkemedia/pdf-extractor)

This package automates the generation of an SQLite database that you can use to do a full-text search on a PDF. Meaning you take your PDF, use this tool to generate a database and then query the database and not the PDF for any text search.

This tool also generates thumbnails that you can use to display your search results however you like.

This is heavily inspired [spatie/pdf-to-image](https://github.com/spatie/pdf-to-image)
and has a dependency of [spatie/pdf-to-text](https://github.com/spatie/pdf-to-text)

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

[](#installation)

You can install the package via composer:

```
composer require falkemedia/pdf-extractor
```

This package requires the installation of ImageMagic and the **imagick** php extension.
Instructions for macOS Catalina + PHP 7.3:

```
brew install imagemagick
pecl install imagick
```

> If there are any errors with imagemagic I suggest [reading through this guide](https://medium.com/@girishkr/install-imagick-on-macos-catalina-php-7-3-64b4e8542ba2)

Also, behind the scenes this package leverages [pdftotext](https://en.wikipedia.org/wiki/Pdftotext). On a mac you can install the binary using brew

```
brew install poppler
```

Usage
-----

[](#usage)

examples/extract\_pdf\_data.php

```
