tecnickcom / tc-lib-pdf-page
PHP library containing PDF page formats and definitions
Fund package maintenance!
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
- dev-main
- 4.16.3
- 4.16.2
- 4.16.1
- 4.16.0
- 4.15.1
- 4.15.0
- 4.14.5
- 4.14.4
- 4.14.3
- 4.14.2
- 4.14.1
- 4.14.0
- 4.13.4
- 4.13.3
- 4.13.2
- 4.13.1
- 4.13.0
- 4.12.0
- 4.11.0
- 4.10.0
- 4.9.0
- 4.8.0
- 4.7.0
- 4.6.0
- 4.5.0
- 4.4.0
- 4.3.23
- 4.3.22
- 4.3.21
- 4.3.20
- 4.3.18
- 4.3.17
- 4.3.15
- 4.3.14
- 4.3.13
- 4.3.11
- 4.3.10
- 4.3.9
- 4.3.8
- 4.3.7
- 4.3.6
- 4.3.5
- 4.3.4
- 4.3.3
- 4.3.2
- 4.2.19
- 4.2.18
- 4.2.17
- 4.2.16
- 4.2.15
- 4.2.14
- 4.2.12
- 4.2.11
- 4.2.10
- 4.2.9
- 4.2.7
- 4.2.6
- 4.2.5
- 4.2.4
- 4.2.3
- 4.2.2
- 4.2.1
- 4.2.0
- 4.1.1
- 4.1.0
- 4.0.11
- 4.0.10
- 4.0.9
- 4.0.8
- 4.0.7
- 4.0.5
- 4.0.4
- 4.0.3
- 3.2.11
- 3.2.10
- 3.2.9
- 3.2.7
- 3.2.6
- 3.2.5
- 3.2.4
- 3.2.3
- 3.2.1
- 3.2.0
- 3.1.10
- 3.1.9
- 3.1.8
- 3.1.7
- 3.1.6
- 3.1.5
- 3.1.4
- 3.1.3
- 3.1.2
- 3.1.1
- 3.1.0
- 3.0.0
- 2.5.13
- 2.5.12
- 2.5.11
- 2.5.10
- 2.5.8
- 2.5.7
- 2.5.6
- 2.5.5
- 2.5.4
- 2.5.3
- 2.5.0
- 2.4.10
- 2.4.9
- 2.4.8
- 2.4.7
- 2.4.6
- 2.4.5
- 2.4.4
- 2.4.3
- 2.4.2
- 2.4.1
- 2.4.0
- 2.3.0
- 2.2.1
- 2.2.0
- 2.1.4
- 2.1.3
- 2.1.2
- 2.1.0
- 2.0.2
- 2.0.1
- 2.0.0
- 1.2.0
- 1.1.23
- 1.1.22
- 1.1.21
- 1.1.20
- 1.1.19
- 1.1.18
- 1.1.17
- 1.1.16
- 1.1.15
- 1.1.14
- 1.1.13
- 1.1.12
- 1.1.11
- 1.1.10
- 1.1.9
- 1.1.8
- 1.1.7
- 1.1.5
- 1.1.4
- 1.1.3
- 1.1.2
- 1.1.1
- 1.1.0
This package is auto-updated.
Last update: 2026-09-05 07:37:37 UTC
README
PHP library to define and render PDF pages.
💖 Part of the tc-lib-pdf / TCPDF ecosystem (100M+ installs). Sponsor its maintenance →
Overview
tc-lib-pdf-page keeps the page stack of a PDF document and outputs the page
tree, the page objects and the content streams.
| 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 geometry
- Named page formats (ISO, ANSI, JIS, envelopes, photographic and other series) and custom sizes
- Portrait, landscape and size-derived orientation
- Conversion between points, millimeters, centimeters and inches
- MediaBox, CropBox, BleedBox, TrimBox and ArtBox, each with its BoxColorInfo guidelines
- Page, header, content and footer margins, with mirrored gutters in booklet mode
- Writable regions: equal columns, or rectangles computed around no-write areas
Page stack
- Add, clone, move, delete and select pages, grouped for per-group numbering
- Page content stack with marks, and
~#PN/~#PTpage number aliases - Annotation references, rotation, preferred zoom and page transitions
- Per-page transparency group policy, disabled in PDF/A mode
- PDF output with optional Flate compression and encryption
Enums
Unit,Orientation,PageBoxType,PageLayout,PageDisplayMode,TransparencyGroupMode
Requirements
- PHP 8.2 or later
- Extension:
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), ); $page->add([ 'format' => 'A4', 'orientation' => 'P', 'margin' => ['PL' => 20, 'PR' => 20, 'PT' => 15, 'PB' => 15], 'columns' => 2, ]); $page->addContent('BT /F1 12 Tf 100 700 Td (Page ~#PN of ~#PT) Tj ET'); $pon = 0; $pdfpages = $page->getPdfPages($pon);
add() returns the sanitized page data, including the page boxes in points, the
normalized margins and the writable regions. getPdfPages() returns the PDF
objects of the whole stack and advances $pon past the last object number used.
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.