PHPackages                             baklysystems/laravel-dompdf - 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. baklysystems/laravel-dompdf

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

baklysystems/laravel-dompdf
===========================

A DOMPDF Wrapper for Laravel with arabic support

v1.0.0(4y ago)24891MITPHPPHP &gt;=7

Since Jun 23Pushed 4y ago2 watchersCompare

[ Source](https://github.com/baklysystems/laravel-dompdf)[ Packagist](https://packagist.org/packages/baklysystems/laravel-dompdf)[ Fund](https://fruitcake.nl)[ GitHub Sponsors](https://github.com/barryvdh)[ RSS](/packages/baklysystems-laravel-dompdf/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (1)Dependencies (6)Versions (33)Used By (0)

DOMPDF Wrapper for Laravel
--------------------------

[](#dompdf-wrapper-for-laravel)

### Laravel wrapper for [Dompdf HTML to PDF Converter](https://github.com/dompdf/dompdf)

[](#laravel-wrapper-for-dompdf-html-to-pdf-converter)

[![Tests](https://github.com/barryvdh/laravel-dompdf/workflows/Tests/badge.svg)](https://github.com/barryvdh/laravel-dompdf/workflows/Tests/badge.svg)

Require this package in your composer.json and update composer. This will download the package and the dompdf + fontlib libraries also.

```
composer require barryvdh/laravel-dompdf

```

Installation
------------

[](#installation)

### Laravel 5.x:

[](#laravel-5x)

After updating composer, add the ServiceProvider to the providers array in config/app.php

```
Barryvdh\DomPDF\ServiceProvider::class,

```

You can optionally use the facade for shorter code. Add this to your facades:

```
'PDF' => Barryvdh\DomPDF\Facade::class,

```

### Lumen:

[](#lumen)

After updating composer add the following lines to register provider in `bootstrap/app.php`

```
$app->register(\Barryvdh\DomPDF\ServiceProvider::class);

```

To change the configuration, copy the config file to your config folder and enable it in `bootstrap/app.php`:

```
$app->configure('dompdf');

```

Using
-----

[](#using)

You can create a new DOMPDF instance and load a HTML string, file or view name. You can save it to a file, or stream (show in browser) or download.

```
    $pdf = App::make('dompdf.wrapper');
    $pdf->loadHTML('Test');
    return $pdf->stream();
```

Or use the facade:

```
    $pdf = PDF::loadView('pdf.invoice', $data);
    return $pdf->download('invoice.pdf');
```

You can chain the methods:

```
    return PDF::loadFile(public_path().'/myfile.html')->save('/path-to/my_stored_file.pdf')->stream('download.pdf');
```

You can change the orientation and paper size, and hide or show errors (by default, errors are shown when debug is on)

```
    PDF::loadHTML($html)->setPaper('a4', 'landscape')->setWarnings(false)->save('myfile.pdf')
```

If you need the output as a string, you can get the rendered PDF with the output() function, so you can save/output it yourself.

Use `php artisan vendor:publish` to create a config file located at `config/dompdf.php` which will allow you to define local configurations to change some settings (default paper etc). You can also use your ConfigProvider to set certain keys.

### Configuration

[](#configuration)

The defaults configuration settings are set in `config/dompdf.php`. Copy this file to your own config directory to modify the values. You can publish the config using this command:

```
    php artisan vendor:publish --provider="Barryvdh\DomPDF\ServiceProvider"
```

You can still alter the dompdf options in your code before generating the pdf using this command:

```
    PDF::setOptions(['dpi' => 150, 'defaultFont' => 'sans-serif']);
```

Available options and their defaults:

- **rootDir**: "{app\_directory}/vendor/dompdf/dompdf"
- **tempDir**: "/tmp" *(available in config/dompdf.php)*
- **fontDir**: "{app\_directory}/storage/fonts/" *(available in config/dompdf.php)*
- **fontCache**: "{app\_directory}/storage/fonts/" *(available in config/dompdf.php)*
- **chroot**: "{app\_directory}" *(available in config/dompdf.php)*
- **logOutputFile**: "/tmp/log.htm"
- **defaultMediaType**: "screen" *(available in config/dompdf.php)*
- **defaultPaperSize**: "a4" *(available in config/dompdf.php)*
- **defaultFont**: "serif" *(available in config/dompdf.php)*
- **dpi**: 96 *(available in config/dompdf.php)*
- **fontHeightRatio**: 1.1 *(available in config/dompdf.php)*
- **isPhpEnabled**: false *(available in config/dompdf.php)*
- **isRemoteEnabled**: true *(available in config/dompdf.php)*
- **isJavascriptEnabled**: true *(available in config/dompdf.php)*
- **isHtml5ParserEnabled**: false *(available in config/dompdf.php)*
- **isFontSubsettingEnabled**: false *(available in config/dompdf.php)*
- **debugPng**: false
- **debugKeepTemp**: false
- **debugCss**: false
- **debugLayout**: false
- **debugLayoutLines**: true
- **debugLayoutBlocks**: true
- **debugLayoutInline**: true
- **debugLayoutPaddingBox**: true
- **pdfBackend**: "CPDF" *(available in config/dompdf.php)*
- **pdflibLicense**: ""
- **adminUsername**: "user"
- **adminPassword**: "password"

### Tip: UTF-8 support

[](#tip-utf-8-support)

In your templates, set the UTF-8 Metatag:

```

```

### Tip: Page breaks

[](#tip-page-breaks)

You can use the CSS `page-break-before`/`page-break-after` properties to create a new page.

```

.page-break {
    page-break-after: always;
}

Page 1

Page 2

```

### License

[](#license)

This DOMPDF Wrapper for Laravel is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT)

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community22

Small or concentrated contributor base

Maturity74

Established project with proven stability

 Bus Factor1

Top contributor holds 72.5% of commits — single point of failure

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.

###  Release Activity

Cadence

Every ~97 days

Recently: every ~277 days

Total

32

Last Release

1698d ago

Major Versions

v0.8.6 → v1.0.02021-09-15

PHP version history (4 changes)v0.1.0PHP &gt;=5.3.0

v0.5.0PHP &gt;=5.4.0

v0.7.0PHP &gt;=5.5.9

v0.8.3PHP &gt;=7

### Community

Maintainers

![](https://www.gravatar.com/avatar/ae40e9a505cc770df9cf08ccc3deae2d3abec9b95df4e0c6dfc852eccc176049?d=identicon)[elbakly](/maintainers/elbakly)

---

Top Contributors

[![barryvdh](https://avatars.githubusercontent.com/u/973269?v=4)](https://github.com/barryvdh "barryvdh (95 commits)")[![GrahamCampbell](https://avatars.githubusercontent.com/u/2829600?v=4)](https://github.com/GrahamCampbell "GrahamCampbell (3 commits)")[![hebatollah](https://avatars.githubusercontent.com/u/830980?v=4)](https://github.com/hebatollah "hebatollah (3 commits)")[![elbakly](https://avatars.githubusercontent.com/u/2504606?v=4)](https://github.com/elbakly "elbakly (2 commits)")[![suryaprakashtiwari01](https://avatars.githubusercontent.com/u/9845920?v=4)](https://github.com/suryaprakashtiwari01 "suryaprakashtiwari01 (2 commits)")[![zaherg](https://avatars.githubusercontent.com/u/27624?v=4)](https://github.com/zaherg "zaherg (2 commits)")[![exussum12](https://avatars.githubusercontent.com/u/1102850?v=4)](https://github.com/exussum12 "exussum12 (1 commits)")[![FrontEndCoffee](https://avatars.githubusercontent.com/u/16303480?v=4)](https://github.com/FrontEndCoffee "FrontEndCoffee (1 commits)")[![garhbod](https://avatars.githubusercontent.com/u/4616198?v=4)](https://github.com/garhbod "garhbod (1 commits)")[![jdavidbakr](https://avatars.githubusercontent.com/u/25177?v=4)](https://github.com/jdavidbakr "jdavidbakr (1 commits)")[![juukie](https://avatars.githubusercontent.com/u/2678657?v=4)](https://github.com/juukie "juukie (1 commits)")[![khaledelmahdi](https://avatars.githubusercontent.com/u/9323496?v=4)](https://github.com/khaledelmahdi "khaledelmahdi (1 commits)")[![koernchen02](https://avatars.githubusercontent.com/u/312900?v=4)](https://github.com/koernchen02 "koernchen02 (1 commits)")[![kyrylokulyhin](https://avatars.githubusercontent.com/u/8543282?v=4)](https://github.com/kyrylokulyhin "kyrylokulyhin (1 commits)")[![Lednerb](https://avatars.githubusercontent.com/u/2056876?v=4)](https://github.com/Lednerb "Lednerb (1 commits)")[![Omranic](https://avatars.githubusercontent.com/u/406705?v=4)](https://github.com/Omranic "Omranic (1 commits)")[![otilor](https://avatars.githubusercontent.com/u/39733548?v=4)](https://github.com/otilor "otilor (1 commits)")[![pactode](https://avatars.githubusercontent.com/u/5956778?v=4)](https://github.com/pactode "pactode (1 commits)")[![perkola](https://avatars.githubusercontent.com/u/4265109?v=4)](https://github.com/perkola "perkola (1 commits)")[![pionl](https://avatars.githubusercontent.com/u/1878831?v=4)](https://github.com/pionl "pionl (1 commits)")

---

Tags

laravelpdfdompdfarabic

###  Code Quality

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/baklysystems-laravel-dompdf/health.svg)

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

###  Alternatives

[barryvdh/laravel-dompdf

A DOMPDF Wrapper for Laravel

7.3k87.6M275](/packages/barryvdh-laravel-dompdf)

PHPackages © 2026

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