Composer PHP handler for pdfgrep
A simple package for reading information via full text search with pdfgrep and using the information in a PHP script.
First add bureaupartners/pdfgrep to your composer.json
composer require bureaupartners/pdfgrep
Then add the following code to your project
use BureauPartners\pdfgrep\pdfgrep; $pdfgrep = new pdfgrep('Document.pdf', 'Dog'); $pdfgrep->getFirstMatch(); // Returns first match in the document $pdfgrep->getMatches(); // Returns all the matches $pdfgrep->getPageNumbers(); // Returns all page numbers with a match
Requires an installation of pdfgrep on the server.
You can install it for example like this:
apt-get install -y poppler-utils apt-get install -y pdfgrep
If you'd like to contribute, please fork the repository and use a feature branch. Pull requests are warmly welcome.
- Repository: https://github.com/bureaupartners/pdfgrep
- Issue tracker: https://github.com/bureaupartners/pdfgrep/issues
The code in this project is licensed under MIT license.