Navigate:
Dompdf
~$DOMPD0.1%

dompdf: HTML to PDF converter for PHP

CSS 2.1 compliant HTML layout and rendering engine.

LIVE RANKINGS • 10:20 AM • STEADY
OVERALL
#384
5
DEVELOPER TOOLS
#79
7
30 DAY RANKING TREND
ovr#384
·Devel#79
STARS
11.1K
FORKS
1.8K
7D STARS
+8
7D FORKS
+3
See Repo:
Share:

Learn more about Dompdf

dompdf is a PHP library that implements an HTML layout and rendering engine capable of converting HTML and CSS to PDF documents. It parses CSS 2.1 and some CSS3 properties, handles complex table layouts, and embeds fonts and images directly into the generated PDF. The library uses the R&OS PDF class internally, eliminating dependencies on external PDF generation tools. Common use cases include generating invoices, reports, and documents from web content in server-side PHP applications.

Dompdf

1

CSS-Driven PDF Rendering

Converts HTML to PDF using standard CSS 2.1 properties and select CSS3 features. Style documents with external stylesheets, inline styles, or element attributes—no proprietary markup or PDF-specific syntax required.

2

Embedded Font Support

Includes DejaVu fonts for Unicode coverage and supports custom TrueType font embedding. Handles multilingual content and special characters beyond standard PDF fonts limited to Windows ANSI encoding.

3

Zero External Dependencies

Runs entirely within PHP without requiring external binaries like wkhtmltopdf or PhantomJS. This pure PHP implementation simplifies deployment across hosting environments and eliminates compatibility issues with system libraries or server configurations.


<?php
require_once 'vendor/autoload.php';

use Dompdf\Dompdf;

$dompdf = new Dompdf();
$dompdf->loadHtml('<h1>Invoice #12345</h1><p>Total: $499.99</p>');
$dompdf->setPaper('A4', 'portrait');
$dompdf->render();
$dompdf->stream('invoice.pdf');


vv3.1.4

Fix stylesheet-related issues with data URI parsing and base stylesheet retrieval

  • Address issue parsing data URIs in stylesheets
  • Address issue retrieving base stylesheet when filegetcontents used before rendering
vv3.1.3

Fix timing of fixed-position element insertion to improve rendering behavior

  • Moves fixed-position element insertion before page reflow callback
vv3.1.2

Fix font selection logic issue introduced in version 3.1.1

  • Fixes issue with the font selection logic introduced in release 3.1.1

See how people are using Dompdf

Loading tweets...


[ EXPLORE MORE ]

Related Repositories

Discover similar tools and frameworks used by developers