Pixel-perfect HTML to PDF, without a browser on the server. The browser measures the layout; PHP only draws the PDF. No headless Chrome, runs on shared hosting.
No browser on the server. A lightweight alternative to headless Chrome, Puppeteer and wkhtmltopdf: no VPS, container or binaries.
Looks exactly like the screen. Unlike Dompdf, mPDF or TCPDF parsing HTML, it supports flexbox, grid, CSS variables, gradients and image filters, because the browser computes the layout.
Real PDFs. Selectable, searchable text with embedded fonts, and 12 bundled open-source font families.
Secure by design. The server never parses HTML, CSS or JavaScript: it only draws validated numbers, colors and text.
Install
composer require geisonq/jh2pdf
Then copy js/jh2pdf.js to your site. Source code on GitHub · package on Packagist.