tecnickcom / tc-lib-pdf-page
PHP library containing PDF page formats and definitions
Fund package maintenance!
Requires
- php: >=8.2
- ext-date: *
- ext-zlib: *
- tecnickcom/tc-lib-color: ^2.7
- tecnickcom/tc-lib-pdf-encrypt: ^2.5
Requires (Dev)
- pdepend/pdepend: ^2.16
- phpcompatibility/php-compatibility: ^10.0.0@dev
- phpunit/phpunit: ^13.1 || ^12.5 || ^11.5
This package is auto-updated.
Last update: 2026-05-27 16:48:24 UTC
README
Page geometry, boxes, and format definitions for PDF documents.
If this project is useful to you, please consider supporting development via GitHub Sponsors.
Overview
tc-lib-pdf-page manages page sizing, orientation, box definitions, and related geometry metadata.
It provides the structural model that document builders use to define media boxes, orientation changes, and page-level defaults consistently. Centralizing these rules improves correctness in multi-page layouts and simplifies downstream rendering code.
| Namespace | \Com\Tecnick\Pdf\Page |
| Author | Nicola Asuni info@tecnick.com |
| License | GNU LGPL v3 - see LICENSE |
| API docs | https://tcpdf.org/docs/srcdoc/tc-lib-pdf-page |
| Packagist | https://packagist.org/packages/tecnickcom/tc-lib-pdf-page |
Features
Page Model
- Standard and custom page size handling
- Orientation and unit conversion helpers
- Region and box definitions (CropBox, TrimBox, and related metadata)
Integration
- Supports PDF composition stacks that need deterministic page geometry
- Pairs with color/encryption libraries for complete page objects
- Typed exceptions for invalid layout parameters
Requirements
- PHP 8.2 or later
- Extensions:
date,zlib - Composer
Installation
composer require tecnickcom/tc-lib-pdf-page
Quick Start
<?php require_once __DIR__ . '/vendor/autoload.php'; $page = new \Com\Tecnick\Pdf\Page\Page( 'mm', new \Com\Tecnick\Color\Pdf(), new \Com\Tecnick\Pdf\Encrypt\Encrypt(false), false, false ); $dims = $page->setBox([], 'CropBox', 0, 0, 210, 297); var_dump($dims['CropBox']);
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/Page/autoload.php';
Contributing
Contributions are welcome. Please review CONTRIBUTING.md, CODE_OF_CONDUCT.md, and SECURITY.md.