celsowm/pagyra-php

A powerful oop PDF generator and HTML to PDF converter in PHP

Installs: 0

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 0

Forks: 0

Open Issues: 0

pkg:composer/celsowm/pagyra-php

dev-main 2025-10-11 19:59 UTC

This package is auto-updated.

Last update: 2025-10-11 19:59:53 UTC


README

A powerful object-oriented library for PDF generation and HTML-to-PDF conversion in pure PHP.

Badges

  • Latest Stable Version
  • Total Downloads
  • License

Overview

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

Features

Programmatic PDF Generation

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

HTML to PDF Conversion

  • 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.).

Advanced Features

  • Linear and radial gradients (preview/development).
  • Automatic page breaks.
  • Block height measurement before rendering.
  • Multiple fonts and variants (bold, italic).

Requirements

  • PHP >= 8.2
  • DOMDocument extension (enabled by default).

Installation

Install via Composer:

composer require celsowm/pagyra-php