denysmedvid / pdfparser
Pdf parser library with secured/encrypted PDF support. A fork of smalot/pdfparser that can read and extract information from pdf files, including encrypted ones (RC4 40/128-bit, AES-128 and AES-256).
Requires
- php: >=7.1
- ext-iconv: *
- ext-openssl: *
- ext-zlib: *
- symfony/polyfill-mbstring: ^1.18
Replaces
- smalot/pdfparser: v2.13.2
This package is auto-updated.
Last update: 2026-08-06 12:28:43 UTC
README
The denysmedvid/pdfparser is a standalone PHP package that provides various tools to extract data from PDF files,
including secured (encrypted) ones.
About this fork
This repository is a fork of smalot/pdfparser. It tracks upstream and adds support for secured PDF files. Issues specific to this fork belong in the fork issue tracker.
Maintenance status
This library is under limited maintenance. It is still kept compatible with supported PHP versions, and community contributions may be accepted. However, there is currently no active feature development and no guarantee that pull requests will be reviewed or merged in a timely manner. If you plan to contribute anything beyond a small, well-scoped fix, please read CONTRIBUTING.md first.
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).
- Added in this fork: Fix for: Secured pdf file are currently not supported.
Currently, extracting form data is 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 denysmedvid/pdfparser
This package replaces smalot/pdfparser, so the namespace (Smalot\PdfParser\) and API stay unchanged.
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.