Overview
tc-lib-pdf-graph implements low-level drawing operations used to build PDF graphic content streams.
It exposes path, paint, clipping, shading, and transform primitives while keeping APIs close to PDF graphics operators, making it a solid foundation for vector rendering and chart-like drawing.
Repository and API Docs
- GitHub: https://github.com/tecnickcom/tc-lib-pdf-graph
- API docs: https://tcpdf.org/docs/srcdoc/tc-lib-pdf-graph
- Packagist: https://packagist.org/packages/tecnickcom/tc-lib-pdf-graph
Project Metadata
| Item | Value |
|---|---|
| Namespace | \Com\Tecnick\Pdf\Graph |
| License | GNU LGPL v3 |
Installation
composer require tecnickcom/tc-lib-pdf-graph
Where It Fits
Use this package when rendering diagrams, overlays, or reusable vector components in PDFs.
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
Integration Notes
- Keep coordinate systems and transforms explicit in reusable helpers.
- Snapshot complex graphic outputs to detect regressions after upgrades.
- Prefer reusable vector templates for repeated visual components.
Requirements
- PHP 8.2 or later
- Extension:
zlib - Composer
Example
<?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 and Packaging
- QA and local checks:
make deps,make help,make qa - Packaging:
make rpm,make deb
Support and Contribution
- Sponsor: https://github.com/sponsors/tecnickcom
- Contribution guide: https://github.com/tecnickcom/tc-lib-pdf-graph/blob/main/CONTRIBUTING.md
- Security policy: https://github.com/tecnickcom/tc-lib-pdf-graph/blob/main/SECURITY.md