PHPackages                             flawlessnode/dompdf-utf8 - 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. [PDF &amp; Document Generation](/categories/documents)
4. /
5. flawlessnode/dompdf-utf8

ActiveLibrary[PDF &amp; Document Generation](/categories/documents)

flawlessnode/dompdf-utf8
========================

HTML to PDF converter for PHP with UTF-8 compatibility

033PHP

Since May 11Pushed 4w agoCompare

[ Source](https://github.com/FlawlessNode/dompdf-utf8)[ Packagist](https://packagist.org/packages/flawlessnode/dompdf-utf8)[ RSS](/packages/flawlessnode-dompdf-utf8/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependenciesVersions (1)Used By (0)

Dompdf UTF-8
============

[](#dompdf-utf-8)

Features
--------

[](#features)

- Handles most CSS 2.1 and a few CSS3 properties, including @import, @media &amp; @page rules
- Supports most presentational HTML 4.0 attributes
- Supports external stylesheets, either local or through http/ftp (via fopen-wrappers)
- Supports complex tables, including row &amp; column spans, separate &amp; collapsed border models, individual cell styling
- Image support (gif, png (8, 24 and 32 bit with alpha channel), bmp &amp; jpeg)
- No dependencies on external PDF libraries, thanks to the R&amp;OS PDF class
- Inline PHP support
- Basic SVG support (see "Limitations" below)

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

[](#requirements)

- PHP version 8.0 or higher
- DOM extension
- MBString extension
- php-font-lib
- php-svg-lib

Note that some required dependencies may have further dependencies (notably php-svg-lib requires sabberworm/php-css-parser).

### Recommendations

[](#recommendations)

- GD (for image processing)
    - Additionally, the IMagick or GMagick extension improves image processing performance for certain image types
- OPcache (OPcache, XCache, APC, etc.): improves performance

Visit the wiki for more information:

About Fonts &amp; Character Encoding
------------------------------------

[](#about-fonts--character-encoding)

PDF documents internally support the following fonts: Helvetica, Times-Roman, Courier, Zapf-Dingbats, &amp; Symbol. These fonts only support Windows ANSI encoding. In order for a PDF to display characters that are not available in Windows ANSI, you must supply an external font. Dompdf will embed any referenced font in the PDF so long as it has been pre-loaded or is accessible to dompdf and reference in CSS @font-face rules. See the [font overview](https://github.com/flawlessnode/dompdf-utf8/wiki/About-Fonts-and-Character-Encoding)for more information on how to use fonts.

The [DejaVu TrueType fonts](https://dejavu-fonts.github.io/) have been pre-installed to give dompdf decent Unicode character coverage by default. To use the DejaVu fonts reference the font in your stylesheet, e.g. `body { font-family: DejaVu Sans; }` (for DejaVu Sans). The following DejaVu 2.34 fonts are available: DejaVu Sans, DejaVu Serif, and DejaVu Sans Mono.

Easy Installation
-----------------

[](#easy-installation)

### Install with composer

[](#install-with-composer)

To install with [Composer](https://getcomposer.org/), simply require the latest version of this package.

```
composer require flawlessnode/dompdf-utf8
```

Make sure that the autoload file from Composer is loaded.

```
// somewhere early in your project's loading, require the Composer autoloader
// see: http://getcomposer.org/doc/00-intro.md
require 'vendor/autoload.php';
```

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

[](#quick-start)

Just pass your HTML in to dompdf and stream the output:

```
// reference the Dompdf namespace
use Dompdf\Dompdf;

// instantiate and use the dompdf class
$dompdf = new Dompdf();
$dompdf->loadHtml('hello world');

// (Optional) Setup the paper size and orientation
$dompdf->setPaper('A4', 'landscape');

// Render the HTML as PDF
$dompdf->render();

// Output the generated PDF to Browser
$dompdf->stream();
```

### Setting Options

[](#setting-options)

Set options during dompdf instantiation:

```
use Dompdf\Dompdf;
use Dompdf\Options;

$options = new Options();
$options->set('defaultFont', 'Courier');
$dompdf = new Dompdf($options);
```

or at run time

```
use Dompdf\Dompdf;

$dompdf = new Dompdf();
$options = $dompdf->getOptions();
$options->setDefaultFont('Courier');
$dompdf->setOptions($options);
```

See [Dompdf\\Options](src/Options.php) for a list of available options.

### Resource Reference Requirements

[](#resource-reference-requirements)

In order to protect potentially sensitive information Dompdf imposes restrictions on files referenced from the local file system or the web.

Files accessed through web-based protocols have the following requirements:

- The Dompdf option "isRemoteEnabled" must be set to "true"
- PHP must either have the curl extension enabled or the allow\_url\_fopen setting set to true

Files accessed through the local file system have the following requirement:

- The file must fall within the path(s) specified for the Dompdf "chroot" option

Limitations (Known Issues)
--------------------------

[](#limitations-known-issues)

- Table cells are not pageable, meaning a table row must fit on a single page: See
- Elements are rendered on the active page when they are parsed.
- Embedding "raw" SVG's (``) isn't working yet: See
    Workaround: Either link to an external SVG file, or use a DataURI like this: ```
    $html = '';
    ```
- Does not support CSS flexbox: See
- Does not support CSS Grid: See
- A single Dompdf instance should not be used to render more than one HTML document because persisted parsing and rendering artifacts can impact future renders.

---

[![Donate button](https://camo.githubusercontent.com/acff8a4af46413276118b9f3b883b373601ac053d9dd5acf8a4e8a944c2538a9/68747470733a2f2f7777772e70617970616c2e636f6d2f656e5f55532f692f62746e2f62746e5f646f6e6174655f534d2e676966)](http://goo.gl/DSvWf)

*If you find this project useful, please consider making a donation. Any funds donated will be used to help further development on this project.)*

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance61

Regular maintenance activity

Popularity10

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity11

Early-stage or recently created project

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/05a3fec9a43d8e91dbd2f2445b3ccc0e16ddf865764d307d6ca1d6b0a726336d?d=identicon)[FlawlessNode](/maintainers/FlawlessNode)

---

Top Contributors

[![bsweeney](https://avatars.githubusercontent.com/u/485897?v=4)](https://github.com/bsweeney "bsweeney (733 commits)")[![Mellthas](https://avatars.githubusercontent.com/u/5852189?v=4)](https://github.com/Mellthas "Mellthas (413 commits)")[![PhenX](https://avatars.githubusercontent.com/u/42170?v=4)](https://github.com/PhenX "PhenX (233 commits)")[![simonberger](https://avatars.githubusercontent.com/u/7163526?v=4)](https://github.com/simonberger "simonberger (47 commits)")[![gabrielbull](https://avatars.githubusercontent.com/u/671923?v=4)](https://github.com/gabrielbull "gabrielbull (38 commits)")[![barryvdh](https://avatars.githubusercontent.com/u/973269?v=4)](https://github.com/barryvdh "barryvdh (18 commits)")[![flaviencrochard](https://avatars.githubusercontent.com/u/564388?v=4)](https://github.com/flaviencrochard "flaviencrochard (13 commits)")[![samuferenc](https://avatars.githubusercontent.com/u/14260068?v=4)](https://github.com/samuferenc "samuferenc (10 commits)")[![ThomasLandauer](https://avatars.githubusercontent.com/u/1054469?v=4)](https://github.com/ThomasLandauer "ThomasLandauer (9 commits)")[![williamdes](https://avatars.githubusercontent.com/u/7784660?v=4)](https://github.com/williamdes "williamdes (7 commits)")[![tomlankhorst](https://avatars.githubusercontent.com/u/675432?v=4)](https://github.com/tomlankhorst "tomlankhorst (6 commits)")[![staabm](https://avatars.githubusercontent.com/u/120441?v=4)](https://github.com/staabm "staabm (5 commits)")[![Starfox64](https://avatars.githubusercontent.com/u/1530720?v=4)](https://github.com/Starfox64 "Starfox64 (5 commits)")[![lquast](https://avatars.githubusercontent.com/u/10726291?v=4)](https://github.com/lquast "lquast (4 commits)")[![eddturtle](https://avatars.githubusercontent.com/u/902607?v=4)](https://github.com/eddturtle "eddturtle (4 commits)")[![IonBazan](https://avatars.githubusercontent.com/u/1985514?v=4)](https://github.com/IonBazan "IonBazan (4 commits)")[![amacneil](https://avatars.githubusercontent.com/u/637671?v=4)](https://github.com/amacneil "amacneil (4 commits)")[![PHPGangsta](https://avatars.githubusercontent.com/u/608408?v=4)](https://github.com/PHPGangsta "PHPGangsta (4 commits)")[![rudiedirkx](https://avatars.githubusercontent.com/u/168024?v=4)](https://github.com/rudiedirkx "rudiedirkx (4 commits)")[![Cyrille37](https://avatars.githubusercontent.com/u/368965?v=4)](https://github.com/Cyrille37 "Cyrille37 (3 commits)")

### Embed Badge

![Health badge](/badges/flawlessnode-dompdf-utf8/health.svg)

```
[![Health](https://phpackages.com/badges/flawlessnode-dompdf-utf8/health.svg)](https://phpackages.com/packages/flawlessnode-dompdf-utf8)
```

###  Alternatives

[qipsius/tcpdf-bundle

A bundle to easily integrate TCPDF into Symfony

23749.5k](/packages/qipsius-tcpdf-bundle)[radnan/rdn-csv

Laminas module to export and import CSV files

19119.3k](/packages/radnan-rdn-csv)[nilgems/laravel-textract

A Laravel package to extract text from files like DOC, XL, Image, Pdf and more. I've developed this package by inspiring "npm textract".

195.7k](/packages/nilgems-laravel-textract)[akeneo-labs/excel-connector-bundle

Akeneo PIM Excel connector bundle

166.4k](/packages/akeneo-labs-excel-connector-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
