tecnickcom/tc-lib-pdf-graph
PHP library containing PDF graphic and geometric methods
Maintainers
Fund package maintenance!
Requires
- php: >=8.2
- ext-zlib: *
- tecnickcom/tc-lib-color: ^2.11
- tecnickcom/tc-lib-pdf-encrypt: ^2.7
Requires (Dev)
- pdepend/pdepend: ^2.16
- phpunit/phpunit: ^11.5 || ^12.5 || ^13.2
Suggests
None
Provides
None
Conflicts
None
Replaces
None
LGPL-3.0-or-later 52aee1241af84cf4a210c9f62bc4d90d29e7efbf
- Nicola Asuni <info.woop@tecnick.com>
This package is auto-updated.
Last update: 2026-06-18 17:50:31 UTC
README
Geometric drawing and transformation primitives for PDF content streams.
👁 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-graph implements low-level drawing operations used to build PDF graphic content.
It exposes the primitives needed to compose paths and painting operations while keeping the API close to PDF graphics operators. This makes it suitable as a foundation layer for charting, vector drawing, and custom layout engines.
| Namespace | \Com\Tecnick\Pdf\Graph |
| Author | Nicola Asuni info@tecnick.com |
| License | GNU LGPL v3 - see LICENSE |
| API docs | https://tcpdf.org/docs/srcdoc/tc-lib-pdf-graph |
| Packagist | https://packagist.org/packages/tecnickcom/tc-lib-pdf-graph |
Features
Drawing Primitives
- Paths, lines, curves, and clipping operations
- Style handling for stroke/fill combinations
- Gradient and shading support
Transformations
- Matrix-based geometric transforms
- Coordinate conversion helpers
- PDF/A-aware behavior controls
Requirements
- PHP 8.2 or later
- Extension:
zlib - Composer
Installation
composer require tecnickcom/tc-lib-pdf-graph
Quick Start
<?php require_once __DIR__ . '/vendor/autoload.php'; $draw = new \Com\Tecnick\Pdf\Graph\Draw( 1.0, 210, 297, new \Com\Tecnick\Color\Pdf(), new \Com\Tecnick\Pdf\Encrypt\Encrypt(), false ); echo $draw->getClippingRect(10, 10, 50, 20);
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/Graph/autoload.php';
Contributing
Contributions are welcome. Please review CONTRIBUTING.md, CODE_OF_CONDUCT.md, and SECURITY.md.
