Image import and embedding utilities for PDF streams.
If this project is useful to you, please consider supporting development via GitHub Sponsors.
tc-lib-pdf-image handles image import, conversion, and output structures used by PDF generators.
The library isolates image pipeline concerns such as format handling, normalization, and object generation for PDF embedding. Keeping this logic separate helps reduce complexity in document-level code and makes image behavior easier to validate and maintain.
| Namespace | \Com\Tecnick\Pdf\Image |
| Author | Nicola Asuni info@tecnick.com |
| License | GNU LGPL v3 - see LICENSE |
| API docs | https://tcpdf.org/docs/srcdoc/tc-lib-pdf-image |
| Packagist | https://packagist.org/packages/tecnickcom/tc-lib-pdf-image |
- Native handling for PNG and JPEG
- Additional format handling through GD processing paths
- Transparency and palette-related metadata handling
- Image caching keys for repeated assets
- Alternate image support for print/display contexts
- Output helpers for embedding image objects
- PHP 8.2 or later
- Extensions:
gd,zlib - Composer
composer require tecnickcom/tc-lib-pdf-image<?php
require_once __DIR__ . '/vendor/autoload.php';
$img = new \Com\Tecnick\Pdf\Image\Import();
$imageId = $img->add('/path/to/image.png');
var_dump($imageId);make deps
make help
make qamake rpm
make debFor system packages, bootstrap with:
require_once '/usr/share/php/Com/Tecnick/Pdf/Image/autoload.php';Contributions are welcome. Please review CONTRIBUTING.md, CODE_OF_CONDUCT.md, and SECURITY.md.
Nicola Asuni - info@tecnick.com