tecnickcom / tc-lib-pdf-graph
PHP library containing PDF graphic and geometric methods
Fund package maintenance!
2.17.2
2026-09-05 07:37 UTC
Requires
- php: ^8.2
- ext-zlib: *
- tecnickcom/tc-lib-color: ^3.0
- tecnickcom/tc-lib-pdf-encrypt: ^2.11
Requires (Dev)
- carthage-software/mago: 1.47.6
- pdepend/pdepend: ^2.16
- phpunit/phpunit: ^11.5 || ^12.5 || ^13.3
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-09-05 07:37:41 UTC
README
Geometric drawing and transformation primitives for PDF content streams.
💖 Part of the tc-lib-pdf / TCPDF ecosystem (100M+ installs). Sponsor its maintenance →
Overview
tc-lib-pdf-graph generates the content stream commands for the graphic and geometric primitives of a PDF document.
| 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
- Points, lines, rectangles and Bezier curves
- Ellipses, circles, elliptical arcs and pie sectors
- Polygons, regular polygons, star polygons and rounded rectangles
- Arrows, crop marks and registration marks
Styles and Painting
- Style stack with line width, cap, join, miter limit, dash pattern and colors
- Path-painting and clipping operators
- Transparency, blend modes and overprint through ExtGState objects
- PDF/A mode that suppresses the ExtGState and shading output
Gradients
- Axial and radial shadings with multiple color stops and per-stop opacity
- Coons patch meshes and color registration bars
Transformations
- Scaling, rotation, mirroring, reflection, translation and skewing
- Transformation matrix product and transformation stack
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.