Draw the document
Drag rows, tables, text and images onto a real A4 or A3 page and style them in the panel beside it — or open a finished template instead of a blank one.
getpdfcode is a visual builder for PHP PDFs. Lay out invoices, reports and certificates on a real page, bind your data, then export ready-to-run code. The nested tables and library quirks are handled for you.
1use Spipu\Html2Pdf\Html2Pdf;
2
3ob_start(); include 'template.php';
4$html = ob_get_clean();
5
6$pdf = new Html2Pdf('P', 'A4', 'en');
7$pdf->writeHTML($html);
8$pdf->output(__DIR__.'/document.pdf', 'F');
1use Dompdf\Dompdf;
2
3ob_start(); include 'template.php';
4$html = ob_get_clean();
5
6$dompdf = new Dompdf();
7$dompdf->loadHtml($html);
8$dompdf->setPaper('A4', 'portrait');
9$dompdf->render();
10file_put_contents('document.pdf',
11 $dompdf->output());
1use Mpdf\Mpdf;
2
3ob_start(); include 'template.php';
4$html = ob_get_clean();
5
6$mpdf = new Mpdf(['format' => 'A4']);
7$mpdf->WriteHTML($html);
8$mpdf->Output('document.pdf', 'F');
No hand-tuned tables, no guessing what each library supports. Design it once and take working code away.
Drag rows, tables, text and images onto a real A4 or A3 page and style them in the panel beside it — or open a finished template instead of a blank one.
Turn the parts that differ per document — a name, a total, a list of line items — into variables. Repeat a row per item, or hide a section by rule.
Download a small Composer project — template, runner, fonts and images. Pass in your data from your own app and it writes the PDF.
Built for developers who would rather design an invoice than debug one.
Rows, columns, tables, text and images on a real page, with images or gradients behind any row. What you see is what renders.
Export for html2pdf, Dompdf or mPDF — the one you already use — and switch libraries later without rebuilding the document.
One template, any number of documents. Bind variables to any element, repeat rows for line items, and show sections only when the data calls for them.
See the real PDF in your browser before you export, rendered by the same engine that will produce your file.
Open a finished résumé, letter or certificate and change what you need — or build up from headers, line-item tables, totals and timelines.
Code 128, EAN, PDF417, DataMatrix and more, drawn as vectors rather than pasted images — sharp at any size, and scanners read them.
We're putting the finishing touches on it. Leave your email and we'll tell you the moment it's live.