← Back to Open-Source PDF Software

Open-Source PHP PDF Software

18 open-source PDF tools written in PHP.

PHP

PHPWord

Library

Writes and reads OOXML (Word 2007+), ODF (ODT), RTF, HTML, and PDF documents: sections with headers/footers/page numbering, styled text runs and paragraphs, tables, images (local/remote/watermark), drawing shapes, charts (pie/bar/line/area/scatter/radar), OLE objects, TOCs, footnotes/endnotes, form fields, lists, template-based generation, and XSL transforms.

PHP

TCPDF

Library

Pure-PHP PDF/barcode generation library covering PDF/barcode generation, text/graphics, digital signatures, form fields, password/public-key encryption, and HTML/CSS rendering.

Depreciated
PHP

tc-lib-pdf

Library

UTF-8/RTL text with TrueType/OpenType/Type1/CID-0 font support and subsetting; HTML/CSS and SVG rendering with multi-column layouts, headers/footers, bookmarks, and TOC; JPEG/PNG/SVG images (plus GIF/BMP/TIFF/etc. via GD); RC4/AES-256 encryption; PAdES/PKCS#7 digital signatures with RFC 3161 TSA timestamps and LTV; PDF/A, PDF/X, and PDF/UA compliance modes; page import/reordering; AcroForm fields; and companion-package barcode support.

PHP

PdfParser

Library

Parses PDF objects/headers to extract text (page by page) and metadata (author, description, etc.), with support for compressed PDFs, Mac OS Roman charset encoding, and hex/octal-encoded text. Does not support secured/encrypted documents or form data extraction.

PHP

markdown-resume

CliDockerDriver

CLI/Docker tool that converts a Markdown resume into a responsive HTML5/CSS3 page and a PDF (via wkhtmltopdf), with selectable themes, a live-reload watch mode, word-frequency stats analysis, and single-file output with embedded styles.

Stale
PHP

mPDF

Library

Generates PDFs from UTF-8 HTML (including CJK content): headers/footers, page numbering, TOC, color handling, embedded fonts, zlib-compressed output, XML-driven charset conversion, basic SVG, and optional barcode generation (via bcmath). Notably lacks state-of-the-art CSS support compared to headless-Chrome-based alternatives.

PHP

PHPPdf

Cli

Converts XML (or Markdown) documents to PDF or images (JPEG/PNG via GD/Imagick/Gmagick) with HTML-like tags (div, p, table, headings, lists, images, links); supports auto-breakable/fixed pages, multi-column layouts, headers/footers/watermarks, page numbering, metadata, internal/external links, bookmarks, sticky notes, barcodes (via Zend), simple pie charts, borders, backgrounds, rotation/transparency, and stylesheets; usable via web or CLI, with Symfony2 integration.

Stale
PHP

browsershot

DriverLibrary

PHP package that drives headless Chrome (via Puppeteer) to convert a URL, HTML string, or local HTML file into a PDF or image; can also extract the rendered HTML body after JavaScript execution and list all network requests the page triggered.

PHP

Snappy

DriverLibrary

PHP wrapper around wkhtmltopdf/wkhtmltoimage that generates PDFs or image snapshots/thumbnails from URLs or HTML, merges multiple URLs into a single PDF, supports XSL-based tables of contents, and passes through wkhtmltox options (page size, margins, cookies, JS); includes Symfony, Laravel, and Zend Framework integrations.

PHP

Laravel PDF

Library

Laravel wrapper around mPDF: renders Blade views to PDF with data binding, custom headers/footers with page numbering, custom TTF fonts, document permission protection (copy/print/modify/extract/assemble), and per-file config overrides, with output via string, save, download, or browser stream.

DepreciatedStale
PHP

Dompdf

Library

Pure-PHP (no external PDF library) HTML-to-PDF converter: CSS 2.1 (with some CSS3) including @import/@media/@page rules, most presentational HTML 4.0 attributes, external/inline stylesheets, complex table rendering (spans, border models), GIF/PNG/BMP/JPEG images, basic SVG, inline PHP, and embedded fonts (bundled DejaVu TrueType for Unicode). Does not support CSS Flexbox/Grid or multi-page table cells.

PHP

Laravel Dompdf

Library

Laravel wrapper around Dompdf: converts HTML strings, files, or Blade views to PDF with paper size/orientation, DPI, fonts, CSS page breaks, and UTF-8 support; generates PDF/A-3b compliant output with embedded files and XMP metadata (for Zugferd/Factur-X e-invoicing); toggles JS/remote-content/PHP execution; outputs to disk, browser stream, download, or string.

PHP

Html2Pdf

Library

Converts specially-cleaned HTML (not arbitrary web pages) into PDF using TCPDF as the underlying engine, for generating documents like invoices and documentation; requires the gd and mbstring PHP extensions. Not designed to render existing websites or WYSIWYG-generated HTML directly.

PHP

pdf-to-image

DriverLibrary

Converts PDFs (via ImageMagick + Ghostscript) to JPG/JPEG/PNG/WebP images: render specific or all pages, control quality/DPI/dimensions/background color, read page count and page dimensions, and handle password-protected PDFs (requires ImageMagick 7).

PHP

FPDF

Library

Free PHP class for generating PDF files in pure PHP, with no PDF library/extension dependency.

PHP

pdf-to-text

Cli

Thin PHP wrapper around the `pdftotext` CLI binary that extracts text from a PDF, with support for a custom binary path, password-protected PDFs, and passthrough of pdftotext options (e.g. layout preservation).

PHP

laravel-snappy

Library

Laravel wrapper around the Snappy library: generates PDFs or images from HTML strings, files, or Laravel views, with output to file/browser/download, wkhtmltopdf/wkhtmltoimage option passthrough (paper size, orientation, margins), and a fake mode for testing without real rendering.

PHP

phpgearbox/pdf

DriverLibrary

Generates PDFs two ways: DOCX templating (variable substitution like `${FOO}`, block cloning, table row duplication, then converted to PDF) or HTML-to-PDF via PhantomJS.

DepreciatedStale