Pdfparser
PdfParser, a standalone PHP library, provides various tools to extract data from a PDF file.
Install / Use
/learn @smalot/PdfparserREADME
PDF parser
The smalot/pdfparser is a standalone PHP package that provides various tools to extract data from PDF files.
This library is under active maintenance. There is no active development by the author of this library (at the moment), but we welcome any pull request adding/extending functionality! See CONTRIBUTING.md for further information about how to contribute.
Features
- Load/parse objects and headers
- Extract metadata (author, description, ...)
- Extract text from ordered pages
- Support of compressed PDFs
- Support of MAC OS Roman charset encoding
- Handling of hexa and octal encoding in text sections
- Create custom configurations (see CustomConfig.md).
Currently, secured documents and extracting form data are not supported.
License
This library is under the LGPLv3 license.
Install
This library requires PHP 7.1+ since v1. You can install it via Composer:
composer require smalot/pdfparser
In case you can't use Composer, you can include alt_autoload.php-dist. It will include all required files automatically.
Quick example
<?php
// Parse PDF file and build necessary objects.
$parser = new \Smalot\PdfParser\Parser();
$pdf = $parser->parseFile('/path/to/document.pdf');
$text = $pdf->getText();
echo $text;
Further usage information can be found here.
Documentation
Documentation can be found in the doc folder.
Related Skills
node-connect
335.2kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
82.5kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
335.2kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
82.5kCommit, push, and open a PR

