PHPackages                             kalle/pdf - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Templating &amp; Views](/categories/templating)
4. /
5. kalle/pdf

ActiveLibrary[Templating &amp; Views](/categories/templating)

kalle/pdf
=========

A lightweight, native PDF engine for PHP for creating structured PDF documents programmatically

0.1.0-alpha1(yesterday)00MITPHPPHP ^8.4

Since Apr 7Pushed todayCompare

[ Source](https://github.com/kalicki2k/pdf)[ Packagist](https://packagist.org/packages/kalle/pdf)[ Docs](https://github.com/kalicki2k/pdf)[ RSS](/packages/kalle-pdf/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (3)Versions (3)Used By (0)

kalle/pdf
=========

[](#kallepdf)

[![PHP 8.4](https://camo.githubusercontent.com/a53f8775e71fe1a6f7977358aa92a4d5fabe1cc8989060bc80e380dda0148158/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e342d3737376262343f6c6f676f3d706870266c6f676f436f6c6f723d7768697465)](https://camo.githubusercontent.com/a53f8775e71fe1a6f7977358aa92a4d5fabe1cc8989060bc80e380dda0148158/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e342d3737376262343f6c6f676f3d706870266c6f676f436f6c6f723d7768697465)[![Tests Passing](https://camo.githubusercontent.com/fa28646bc477a1355f932fb9035b4d48c5d857b1a68187d4637fbddb5a9129c2/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f74657374732d70617373696e672d3265613434663f6c6f676f3d676974687562616374696f6e73266c6f676f436f6c6f723d7768697465)](https://camo.githubusercontent.com/fa28646bc477a1355f932fb9035b4d48c5d857b1a68187d4637fbddb5a9129c2/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f74657374732d70617373696e672d3265613434663f6c6f676f3d676974687562616374696f6e73266c6f676f436f6c6f723d7768697465)[![PHPStan No Errors](https://camo.githubusercontent.com/87da356414041aedf24d97c040611997288f3e31625031db46ebf1a4c539f3da/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d6e6f2532306572726f72732d3265613434663f6c6f676f3d706870266c6f676f436f6c6f723d7768697465)](https://camo.githubusercontent.com/87da356414041aedf24d97c040611997288f3e31625031db46ebf1a4c539f3da/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d6e6f2532306572726f72732d3265613434663f6c6f676f3d706870266c6f676f436f6c6f723d7768697465)[![Code Coverage 100%](https://camo.githubusercontent.com/80ac4d9e0a595992dcead8ba4ba2643124aa050831a3c7ae28a0b399ee360fd5/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f7665726167652d3130302532352d3265613434663f6c6f676f3d636f6465636f76266c6f676f436f6c6f723d7768697465)](https://camo.githubusercontent.com/80ac4d9e0a595992dcead8ba4ba2643124aa050831a3c7ae28a0b399ee360fd5/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f7665726167652d3130302532352d3265613434663f6c6f676f3d636f6465636f76266c6f676f436f6c6f723d7768697465)[![License MIT](https://camo.githubusercontent.com/b32993a2acd8fc319fac4a24811e31362d9ff16591a44539e72b8495ef5f9e70/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d3166366665623f6c6f676f3d6f70656e2d736f757263652d696e6974696174697665266c6f676f436f6c6f723d7768697465)](https://camo.githubusercontent.com/b32993a2acd8fc319fac4a24811e31362d9ff16591a44539e72b8495ef5f9e70/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d3166366665623f6c6f676f3d6f70656e2d736f757263652d696e6974696174697665266c6f676f436f6c6f723d7768697465)

A lightweight, native PDF engine for PHP for creating structured PDF documents programmatically.

Overview
--------

[](#overview)

`kalle/pdf` builds PDF documents from a small PHP object model and renders them directly to PDF syntax.

Current core coverage includes:

- documents and pages
- text with standard and embedded fonts
- simple flow layout via `TextFrame`
- lists and basic tables
- images, lines, rectangles, and path-based shapes
- links and named destinations
- classic PDF info metadata and XMP metadata
- optional password-based PDF encryption
- outlines, named table-of-contents placement, logical TOC page numbers, attachments, layers, and basic form fields

The current focus is a stable core library. PDF/A, PDF/UA, and full tagged-PDF compliance are not the current target yet.

Requirements
------------

[](#requirements)

- PHP `^8.4`
- `ext-mbstring`
- Composer

Installation
------------

[](#installation)

```
composer require kalle/pdf
```

Quick Start
-----------

[](#quick-start)

The public entry points live in the root namespace:

- `Kalle\Pdf\Document`
- `Kalle\Pdf\Page`
- `Kalle\Pdf\TextFrame`
- `Kalle\Pdf\Table`

```
