The visual builder for html2pdf, Dompdf & mPDF.

A visual PHP PDF builder: design on a drag-and-drop canvas, then export clean, ready-to-run PHP that turns your document from HTML to PDF. getpdfcode handles the nested tables and per-library quirks — you never touch them.

3
Export libraries
5
Starter templates
20+
Ready-made blocks
Free
To get started
Invoice Template — getpdfcode
Builder
Preview
</>Get Code
Structure
▭
Row
▥
Columns
Text
T
Text
H
Heading
Media
◱
Image
▣
QR Code
|||
Barcode
Properties
Width
Alignment
Background
Padding
A canvas of rows, columns and blocks
Works with your stack

Export to the PHP library you already use

One visual PDF builder for html2pdf, Dompdf and mPDF. Design once, export clean PHP for any of the three, and switch engines without rebuilding.

html2pdf builder

Built on TCPDF

Design it visually, export spipu/html2pdf PHP. Draws codes itself and has the strongest encryption. The slowest, and the fragile one when tables nest deep.

$ composer require spipu/html2pdf

Dompdf builder

Pure PHP

Design it visually, export Dompdf PHP. The most predictable box model of the three, and the steadiest when tables nest deep.

$ composer require dompdf/dompdf

mPDF builder

Feature-rich

Design it visually, export mPDF PHP. The broadest CSS and the best Unicode, and the fastest on a long document.

$ composer require mpdf/mpdf
html2pdf vs Dompdf vs mPDF: which one?Answer a few questions about your document and we'll rank them for you.
Features

Everything you need
to ship a PDF

From blank canvas to production-ready PHP in minutes — not days of wrestling with library quirks.

🎨

Visual builder

Drag rows, columns, tables, text and images onto a real A4 or A3 canvas, and fill any row with an image or a gradient. What you see is what renders.
⚡

Export to 3 PHP libraries

Clean, runnable PHP for html2pdf, Dompdf and mPDF — every library on every plan, unlimited.
🧩

Templates & ready-made blocks

Open a finished résumé, letter or certificate and change what you need — or build up from blocks: headers, line-item tables, totals, timelines.
🔗

Data binding, loops & conditions Pro

One template, any number of documents. Bind variables to any element, repeat a row for every line item, and show or hide sections based on the data you pass in.
👁️

Live preview

See the real PDF in your browser before you export. It is rendered by the same engine that will produce your file, so nothing changes on the way out.
🔤

Licensed font library Pro

Real typefaces instead of the three faces every PDF engine ships with. Every family is licensed for embedding and for redistribution, so the font travels with your document and with the code you export.
🏷️

QR codes & barcodes

Code 128, EAN, PDF417, DataMatrix and more, drawn as vectors rather than pasted in as images — so they stay sharp at any size and scanners read them.
🔒

Watermarks & protection Pro

Stamp a text or image watermark across the page, and lock the finished PDF with a password — or allow reading while blocking printing, copying and editing.
👥

Workspaces Pro

Group projects into workspaces — one per client, one per brand, or however you already think about your work — so a long list stays findable.
How it works

Three steps to your first PDF

Draw it once, mark the parts that change, and leave with the PHP that generates it.

1 Step 1 of 3

Draw the document

Drag rows, tables, text and images onto a real page and style them in the panel beside it. Start from a finished template if you would rather not begin with a blank one.

The canvas is the same size as the paper — nothing shifts later.

2 Step 2 of 3

Mark what changes Pro

Turn the parts that differ per document — a name, a total, a table of line items — into variables. Add a rule to hide a section, or repeat a row once per item.

One template then covers every invoice, not one of them.

{{ total }}→$4,250.00
3 Step 3 of 3

Take the PHP away

Download a small Composer project — a template file, a runner, your fonts and images. Pass in your data, call it from your own app, and it writes the PDF.

Yours to keep: no API to call, no account needed to run it.

$pdf->output('invoice.pdf');
Pricing

Simple, honest pricing

Start free. Upgrade when you need the full toolkit.

Free
$0
forever free
✓
All 3 export libraries — html2pdf, Dompdf and mPDF
✓
3 projects
✓
5 starter templates
✓
Row backgrounds & gradients
✓
Change page size later
✕
Dynamic data, conditions & loops
✕
The font library
✕
PDF protection
✕
Watermarks
✕
Workspaces
Get started free
Questions

html2pdf, Dompdf and mPDF, answered

Whether a visual builder can do the job, and how the three PHP PDF libraries compare.

Is there a visual builder for Dompdf?

Yes. getpdfcode is a drag-and-drop PDF builder that exports ready-to-run Dompdf code: design the document on a canvas, preview it rendered by Dompdf itself, and download a Composer project that uses dompdf/dompdf. Where Dompdf has no native QR codes or barcodes, they arrive as vector SVG, so they stay sharp and scan.

Can I design mPDF templates with drag and drop?

Yes. Lay the page out visually and export PHP for mpdf/mpdf. mPDF is the strongest of the three for Arabic, Hebrew and Indic scripts and draws its own barcodes; where it cannot round a table cell's corners, the export bakes the rounded box into the background for you.

Is there a WYSIWYG editor for html2pdf?

Yes, for the PHP library spipu/html2pdf, which is built on TCPDF (not the JavaScript html2pdf.js). The export works around TCPDF's weak spots: nested columns are given point widths so they do not drift, and background images are scaled to the row first, because TCPDF has no background-size.

Dompdf vs mPDF: which is better?

mPDF supports more HTML and CSS, handles right-to-left and Indic scripts far better, and was the fastest of the three on a long document. Dompdf has the most predictable layout, signs PDFs natively, and keeps its fonts inline in the exported template, which makes the project the simplest of the three to move to another server. For invoices and reports either works well.

html2pdf vs Dompdf: what is the difference?

html2pdf draws QR codes, barcodes, PDF417 and DataMatrix itself and has the strongest encryption, AES-256. Dompdf was almost three times faster on the same 40-page document (14 seconds against 40), stays steadier when tables nest deep, and understands modern colour syntax, which TCPDF drops.

html2pdf vs mPDF: which should I pick?

mPDF was the fastest of the three on a 40-page document, about 10 seconds against html2pdf's 40, and has the broadest CSS. html2pdf is the only one that resolves percentage heights by itself, and the only one with AES-256 encryption and native PDF417 and DataMatrix codes.

Can I switch between html2pdf, Dompdf and mPDF later?

Yes. One design exports to any of the three, so changing library means exporting again, not rebuilding the document. The live preview renders with the engine you choose, so you can see the differences before you switch.

Does the exported code work with Laravel?

Yes. You download an ordinary Composer project: a template file, a runner, and your fonts and images. Call it from Laravel, Symfony or plain PHP and it writes the PDF. Nothing in it depends on getpdfcode.

Ship your first PDF today.

Design it visually, export the code, done. No credit card to start.

Create free account →Explore features