tecnickcom/tc-lib-pdf-filter
PHP library to decode PDF compression and encryption filters
Maintainers
Fund package maintenance!
Requires
- php: >=8.2
- ext-pcre: *
- ext-zlib: *
Requires (Dev)
- pdepend/pdepend: ^2.16
- phpunit/phpunit: ^11.5 || ^12.5 || ^13.2
Suggests
- ext-imagick: Required for JPXDecode (JPEG 2000) filter support
Provides
None
Conflicts
None
Replaces
None
LGPL-3.0-or-later f3aa4fae848687202f93988d04a2b270de30f791
- Nicola Asuni <info.woop@tecnick.com>
This package is auto-updated.
Last update: 2026-06-16 09:01:17 UTC
README
Decoder library for standard PDF stream filters.
👁 Latest Stable Version
👁 Build
👁 Coverage
👁 License
👁 Downloads
If this project is useful to you, please consider supporting development via GitHub Sponsors.
Overview
tc-lib-pdf-filter decodes compression and transformation filters defined by the PDF specification.
It is intended for both generation and parsing workflows where PDF streams must be encoded or decoded according to the standard filter pipeline. By isolating filter logic in one component, callers get predictable behavior and easier testing across different document inputs.
| Namespace | \Com\Tecnick\Pdf\Filter |
| Author | Nicola Asuni info@tecnick.com |
| License | GNU LGPL v3 - see LICENSE |
| API docs | https://tcpdf.org/docs/srcdoc/tc-lib-pdf-filter |
| Packagist | https://packagist.org/packages/tecnickcom/tc-lib-pdf-filter |
Features
PDF Filters
FlateDecode,LZWDecode,RunLengthDecodeASCIIHexDecode,ASCII85DecodeCCITTFaxDecode,DCTDecode,JPXDecode,JBIG2Decode
API Design
- Decode one filter or apply multiple filters in sequence
- Pure-PHP implementation suitable for parser integration
- Typed exceptions for unknown/invalid filter handling
Requirements
- PHP 8.2 or later
- Extensions:
zlib,pcre - Composer
Installation
composer require tecnickcom/tc-lib-pdf-filter
Quick Start
<?php require_once __DIR__ . '/vendor/autoload.php'; $filter = new \Com\Tecnick\Pdf\Filter\Filter(); $decoded = $filter->decodeAll(['ASCIIHexDecode', 'FlateDecode'], $data);
Development
make deps
make help
make qa
Packaging
make rpm make deb
For system packages, bootstrap with:
require_once '/usr/share/php/Com/Tecnick/Pdf/Filter/autoload.php';
Contributing
Contributions are welcome. Please review CONTRIBUTING.md, CODE_OF_CONDUCT.md, and SECURITY.md.
