PHP · LARAVEL · SNAPPY

Keep Snappy.
Replace wkhtmltopdf.

Snappy and laravel-snappy hand HTML to a wkhtmltopdf executable. Set its path to Marqius and keep your Blade views and PDF calls.

curl -fsSL https://marqius.com/marqius-wkhtmltopdf.sh | bash
wkhtmltopdf (current)Marqius (Snappy)
Illustrative pair of matching sample invoices
A simple, drop-in migration Keep your PHP & Laravel workflow Install in minutes Compare your own PDFs
1

Install

Install the compatible program alongside your current wkhtmltopdf.

curl -fsSL https://marqius.com/marqius-wkhtmltopdf.sh | bash
2

Laravel configuration

Set the two binary paths in the environment used by config/snappy.php.

WKHTML_PDF_BINARY=/usr/local/bin/wkhtmltopdf
WKHTML_IMG_BINARY=/usr/local/bin/wkhtmltoimage
3

Compare output

Render a representative document and check the PDF before switching production.

marqius wkhtmltopdf invoice.html new.pdf
marqius compare old.pdf new.pdf
PRACTICAL DETAILS

What to check before you switch.

Symfony and plain PHP

use Knp\Snappy\Pdf;
$snappy = new Pdf('/usr/local/bin/wkhtmltopdf');
$snappy->generateFromHtml($html, '/tmp/invoice.pdf', ['page-size' => 'A4']);

Compare your output

Keep a known invoice or report PDF. Generate it with Marqius, then compare it before moving the server path.

Marqius is proprietary software from Simple AI LLC. It is independent of the wkhtmltopdf project. Other product names identify the tools discussed in these guides.
QUESTIONS & ANSWERS

PHP & Laravel questions

Do my Blade views change?

No when Snappy runs a wkhtmltopdf executable. Keep your views and PDF calls, then point the binary setting to the installed program.

Do header and footer views still work?

Test your existing header and footer HTML with the familiar command options and inspect the rendered pages before rollout.

What if Snappy reports exit code 1?

Read the converter output for the missing input, asset or other specific error. Reproduce it with one HTML document before changing a production worker.

What about Browsershot or spatie/laravel-pdf?

Those can use a browser-based rendering path rather than the wkhtmltopdf executable. Check the package integration before replacing a binary.