A powerful object-oriented library for PDF generation and HTML-to-PDF conversion in pure PHP.
- Latest Stable Version
- Total Downloads
- License
Pagyra PHP is a robust and flexible library for creating PDF documents programmatically or directly converting from HTML/CSS. Designed with a fluent, object-oriented API, it provides fine-grained control over layout, styles, images, tables, and more — without relying on extensions like imagick or gd.
📦 Package on Packagist: celsowm/pagyra-php
- Add text, paragraphs, lists, tables, and images.
- Precise control of fonts (TTF), colors, spacing, alignment, and line breaks.
- Create complex layouts with blocks, columns, and positioning (relative, absolute, fixed, sticky).
- Rounded borders, text shadows, and underlines.
- Add clickable links.
- Define headers and footers repeated on every page.
- Built-in HTML parser.
- Supports inline and embedded CSS.
- Renders common tags such as
<p>,<div>,<ul>,<ol>,<li>,<table>,<strong>,<em>,<a>, etc. - Applies basic CSS styles (
color,font-size,text-align,font-weight,text-decoration,margin, etc.).
- Linear and radial gradients (preview/development).
- Automatic page breaks.
- Block height measurement before rendering.
- Multiple fonts and variants (bold, italic).
- PHP >= 8.2
- DOMDocument extension (enabled by default).
Install via Composer:
composer require celsowm/pagyra-php