Skip to content

tecnickcom/tc-lib-pdf-page

tc-lib-pdf-page

Page geometry, boxes, and format definitions for PDF documents.

Latest Stable Version Build Coverage License Downloads

Donate via PayPal

If this library helps your layout engine, please consider supporting development via PayPal.


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.1 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.


Contact

Nicola Asuni - info@tecnick.com

About

PHP library containing PDF page formats and definitions

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Sponsor this project

Packages

 
 
 

Contributors