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

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

artjoker/laravel-dompdf
=======================

A DOMPDF Wrapper for Laravel

v1.0.1(2y ago)026MITPHPPHP ^7.2 || ^8.0

Since Oct 17Pushed 2y ago2 watchersCompare

[ Source](https://github.com/artjoker/laravel-dompdf)[ Packagist](https://packagist.org/packages/artjoker/laravel-dompdf)[ RSS](/packages/artjoker-laravel-dompdf/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (6)Versions (3)Used By (0)

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

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

### Fork from [DOMPDF Wrapper for Laravel](https://github.com/barryvdh/laravel-dompdf)

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

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

[](#installation)

### Laravel

[](#laravel)

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

```
composer require artjoker/laravel-dompdf

```

### Lumen

[](#lumen)

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

```
$app->register(\Artjoker\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.

```
    use Artjoker\DomPDF\Facade\Pdf;

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

or use the App container:

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

Or use the facade:

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="Artjoker\DomPDF\ServiceProvider"
```

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

```
    Pdf::setOption(['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

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 50% 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 ~0 days

Total

2

Last Release

938d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4494b41d92c564ee19e52ec8d2cb2805a5b67618b57579427e5cca9a7d2dbacf?d=identicon)[artjoker](/maintainers/artjoker)

---

Top Contributors

[![VT2](https://avatars.githubusercontent.com/u/12473376?v=4)](https://github.com/VT2 "VT2 (2 commits)")[![artjoker](https://avatars.githubusercontent.com/u/2072311?v=4)](https://github.com/artjoker "artjoker (1 commits)")[![artjokerdaniil](https://avatars.githubusercontent.com/u/116719347?v=4)](https://github.com/artjokerdaniil "artjokerdaniil (1 commits)")

---

Tags

laravelpdfdompdf

###  Code Quality

Code StylePHP\_CodeSniffer

### Embed Badge

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

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

###  Alternatives

[barryvdh/laravel-dompdf

A DOMPDF Wrapper for Laravel

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

PHPackages © 2026

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