PHPackages                             traincase/laravel-pdf-tinker - 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. traincase/laravel-pdf-tinker

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

traincase/laravel-pdf-tinker
============================

Live tinkering with HTML templates for conversion to PDF.

2.2.0(8mo ago)44304MITBladePHP ^8.3

Since Mar 24Pushed 8mo ago3 watchersCompare

[ Source](https://github.com/traincase/laravel-pdf-tinker)[ Packagist](https://packagist.org/packages/traincase/laravel-pdf-tinker)[ RSS](/packages/traincase-laravel-pdf-tinker/feed)WikiDiscussions master Synced today

READMEChangelog (4)Dependencies (6)Versions (9)Used By (0)

Laravel PDF Tinker
==================

[](#laravel-pdf-tinker)

**This package is meant as a tool for local development. Do not include this package in your production build.**

[![Latest Version on Packagist](https://camo.githubusercontent.com/3f2c23d9e3ab8d5b0821bc6536d6c7ebb9a041869a2d1359bf1b00e726cb8b4f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f747261696e636173652f6c61726176656c2d7064662d74696e6b65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/traincase/laravel-pdf-tinker)[![Quality Score](https://camo.githubusercontent.com/ffaae7b1c217736ebcaccf77fd87eab94d93c9718dba95164a94782c5ffae59f/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f747261696e636173652f6c61726176656c2d7064662d74696e6b65722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/traincase/laravel-pdf-tinker)

Laravel PDF Tinker gives you a quick interface to debug and fiddle with the creation of HTML templates that will be converted into PDF's.

If you're one of those guys that frequently has to create custom templates for every client (order confirmations, goods deliveries, invoices etc.) this package is for you.

[![alt text](https://github.com/traincase/laravel-pdf-tinker/raw/master/screenshot.png "Screenshot of playground")](https://github.com/traincase/laravel-pdf-tinker/raw/master/screenshot.png)

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

[](#installation)

Since this package is only meant for during local development install this package as a development dependency.

`composer require traincase/laravel-pdf-tinker --dev`

The package will automatically register it's service provider, if you [opted out of auto-discovery](https://laravel.com/docs/packages#package-discovery) add something along the lines of the following to a registered service provider (for example the `AppServiceProvider`):

```
// Put this inside the 'register' method
if ($this->app->isLocal()) {
    $this->register(\Traincase\LaravelPdfTinker\PdfTinkerServiceProvider::class);
}
```

Don't forget to check [the drivers section](#drivers) to see if the driver you're planning to use requires any additional set-up.

Usage
-----

[](#usage)

You can find most options straight in the interface of the playground. Chances are high you don't have to edit the configuration. Nevertheless, there are a few things you can configure.

### Configuration

[](#configuration)

#### Route prefix

[](#route-prefix)

The service provider will register a few routes necessary to set up and run the playground. By default the routes are all prefixed with `vendor/laravel-pdf-tinker`. This means the playground is available at `your-app.tld/vendor/laravel-pdf-tinker/playground`.

Do you have an unlikely collision with your routes? No worries!

You may publish the configuration file (`php artisan vendor:publish`) and edit the `route_prefix` key in `config/laravel-pdf-tinker.php` to use a different prefix of your liking.

#### Driver options

[](#driver-options)

If you published the configuration file you can also update the `default_driver_options.` key to set the default options that will be set in the interface (under Configuration &gt; Options). This will just be used when you enter the playground, you can always update the configuration inside the playground. Any changes will not be persisted once you leave the page, so if you tinker a lot you might want to override the default options.

### Drivers

[](#drivers)

Currently there are two drivers available.

#### DomPDF

[](#dompdf)

[DomPdf](https://github.com/dompdf/dompdf) is the easiest driver to get started. Everything should already be in place after following the installation instructions.

Happy tinkering!

#### Wkhtmltopdf

[](#wkhtmltopdf)

The wkhtmltopdf driver needs the `wkhtmltopdf` executable to be available in your PATH. This means that if you run `wkhtmltopdf --version` in a terminal it should output something like the following:

```
$ wkhtmltopdf --version
wkhtmltopdf 0.12.5 (with patched qt)
```

If you're using mac&amp;homebrew you can run `brew cask install wkhtmltopdf`. On any other system download the binaries for your system from the [wkhtmltopdf website](https://wkhtmltopdf.org/downloads.html).

#### Creating your own drivers

[](#creating-your-own-drivers)

It's possible to create a driver of the HTML2PDF generation library of your choice. Simply create your driver and register it with the `PdfTinkerManager`.

1. First things first, this is the time to create your driver. Your driver should extend `\Traincase\HtmlToPdfTinker\Drivers\Driver`. You can take an example from `Traincase\LaravelPdfTinker\DompdfDriver`.
2. Register it with the `PdfTinkerManager`. Add the following lines to one of your registered service providers in the `boot` method. ```
    public function boot()
    {
        if ($this->app->isLocal()) {
            $this->app->resolving(\Traincase\HtmlToPdfTinker\PdfTinkerManager::class, function($manager) {
                $manager->extend('test-driver', function() {
                    // Need to fetch some things from the container? Sure.
                    $dependency = $this->app->make(\SomeFancyClass::class);

                    return new \App\Drivers\YourFancyDriver($dependency);
                });
            });
        }
    }
    ```
3. Your driver will automatically show up in the interface in the drivers dropdown, you're free to tinker!

### Ready, set...

[](#ready-set)

If you followed all the installation instructions go ahead and tinker away! Open up your browser and navigate to `your-app.tld/vendor/laravel-pdf-tinker/playground`.

###  Health Score

45

—

FairBetter than 92% of packages

Maintenance60

Regular maintenance activity

Popularity19

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity76

Established project with proven stability

 Bus Factor1

Top contributor holds 59.1% 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 ~331 days

Recently: every ~398 days

Total

7

Last Release

250d ago

Major Versions

0.1 → 1.0.02020-10-31

1.x-dev → 2.0.02022-04-27

PHP version history (4 changes)0.1PHP ^7.4

1.0.1PHP ^7.4 || ^8.0

2.0.0PHP ^8.0

2.1.0PHP ^8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/2681e8e26e77bb8f49623213f977d6fc1ab14046074755cf1b1e2b466df6ebbe?d=identicon)[jelleroorda](/maintainers/jelleroorda)

---

Top Contributors

[![jelleroorda](https://avatars.githubusercontent.com/u/9193686?v=4)](https://github.com/jelleroorda "jelleroorda (13 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (9 commits)")

---

Tags

htmllaravelpdf-generationplaygroundlaravelpdfhtmlpreviewhtml2pdf

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/traincase-laravel-pdf-tinker/health.svg)

```
[![Health](https://phpackages.com/badges/traincase-laravel-pdf-tinker/health.svg)](https://phpackages.com/packages/traincase-laravel-pdf-tinker)
```

###  Alternatives

[spipu/html2pdf

Html2Pdf is a HTML to PDF converter written in PHP - It uses TCPDF - OFFICIAL PACKAGE

1.8k10.6M45](/packages/spipu-html2pdf)[spiritix/php-chrome-html2pdf

A PHP library for converting HTML to PDF using Google Chrome

153472.0k3](/packages/spiritix-php-chrome-html2pdf)[danielboendergaard/phantom-pdf

A Package for generating PDF files using PhantomJS

72467.9k](/packages/danielboendergaard-phantom-pdf)[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.2k](/packages/nilgems-laravel-textract)[eve/pdf-converter

Laravel package to convert HTML to PDF, supporting multiple drivers.

114.1k](/packages/eve-pdf-converter)

PHPackages © 2026

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