§ dompdf alternative
dompdf Alternative: Real Chromium Rendering for PHP and Laravel
dompdf is the default HTML to PDF library in most PHP and Laravel projects, and its ceiling is well known: it implements its own CSS engine, roughly a subset of CSS 2.1, so flexbox, grid, modern web fonts and any JavaScript are out of reach. When your template outgrows that, the honest options are mPDF, Spatie Browsershot on your own headless Chrome, or a rendering API. Sitepdf renders your HTML in managed Chromium, so the PDF matches the browser, and keeps a dated copy of it.
- Early access, launching soon
- No card required
- Your HTML stays yours
§ Short answer
People search for a dompdf alternative when a layout that looks right in Chrome comes out broken from dompdf. The cause is structural: dompdf parses HTML and CSS in pure PHP with its own engine, which is close to CSS 2.1 and does not support flexbox, CSS grid or JavaScript, and handles web fonts awkwardly. For simple documents dompdf is free and fine, so if your invoice is a basic table you should probably keep it. When you need modern CSS to survive, you have three real choices: move up to mPDF for better CSS inside the same pure PHP family, run Spatie Browsershot to drive a real headless Chrome yourself, or call a rendering API that runs the browser for you. Sitepdf is the last option: send HTML or a URL, get a pixel faithful PDF from managed Chromium, with an optional timestamped archive of the source, and no browser to install on your servers.
Last updated July 2026. Written and fact checked by the Sitepdf team.
§ 00
dompdf and the alternatives, compared honestly
dompdf and mPDF are free open source PHP libraries. Browsershot is free but you run the browser. Sitepdf figures are planned launch pricing, labelled planned because the API is in early access.
| dompdf | Browsershot (self-host) | Sitepdf | |
|---|---|---|---|
| Rendering engine | Own pure-PHP engine, ~CSS 2.1 | Real headless Chrome | Managed Chromium |
| Flexbox and CSS grid | No | Yes | Yes |
| Web fonts | Fiddly, often wrong | Yes | Yes |
| Runs JavaScript | No | Yes | Yes |
| Matches what Chrome shows | Only for simple CSS | Yes | Yes |
| Infrastructure to run it | None, pure PHP | Node and Chrome on every server | None, it is an API |
| Works on shared hosting | Yes | Usually not | Yes |
| Cost | Free | Free plus your server and ops time | $29/mo planned |
| Timestamped record of the source | No | No | Yes. archive=true. |
dompdf is genuinely the right tool for simple, controlled layouts, and it is free. This page is about the case where your template needs modern CSS or JavaScript that dompdf cannot render, which is when people go looking for an alternative in the first place.
§ 01
Where dompdf is still the right choice
dompdf installs in one Composer command, runs in pure PHP with no system dependencies, and for a straightforward document it just works. A plain invoice, a receipt, a table heavy report, a letter: if the layout is simple and you build it with dompdf in mind, the output is fine and it costs nothing. On shared hosting where you cannot install a browser, that matters even more. Do not replace dompdf because a blog told you to; replace it when it actually fails your template.
The failure is specific and easy to recognize. Your page uses flexbox or CSS grid and the columns collapse into a stack. A web font renders as a fallback. A chart that draws with JavaScript is simply blank, because dompdf has no browser to run the script. Those are not bugs you can configure away; they are the edges of a CSS 2.1 era engine. When you hit them, it is time to move.
§ 02
mPDF: the upgrade inside the pure PHP family
If dompdf is close but you need better CSS support or non Latin scripts, mPDF is the natural next step and stays inside the pure PHP world, so there is still no browser to install. It handles more CSS, has solid Unicode and right to left support, and is a reasonable pick for multilingual reports and certificates. What it does not do is change categories: mPDF still parses HTML and CSS itself rather than rendering in a browser, so flexbox, grid and JavaScript remain out of reach. If your template was designed for the web and depends on modern layout, mPDF will get you closer than dompdf but not all the way. The HTML to PDF in PHP guide walks through each of these libraries with working code.
§ 03
Browsershot or an API: when you need the browser
When the PDF has to match a modern browser, both honest options use one. Spatie Browsershot drives a real headless Chrome from PHP, so your flexbox, grid, web fonts and JavaScript all render correctly. The cost is that you now run headless Chrome in production: Node and Chrome installed on every server and container, kept patched, and the operational reality that the browser leaks memory, spikes CPU and crashes under concurrency. On shared hosting it is usually not even possible. We cover that true cost in the library versus API comparison and the wider case in the Puppeteer alternative page.
Sitepdf runs that same Chromium for you. From PHP it is one HTTP request: no Node, no Chrome, no memory management, and it works on shared hosting because nothing renders on your box. Add archive=true and it also stores a timestamped snapshot of exactly what was rendered, retrievable later by id, which no PHP library gives you. Note that this is a different situation from Snappy over wkhtmltopdf, another popular dompdf successor, which wraps a binary that was archived in 2023 with an unpatched critical CVE; see the wkhtmltopdf alternative page for why that route is off the table for new work.
$response = Http::withToken(config('services.sitepdf.key'))
->asForm()
->post('https://api.sitepdf.com/v1/render', [
'html' => view('invoices.show', ['invoice' => $invoice])->render(),
'format' => 'Letter',
'archive' => true, // keep a timestamped copy of this document
]);
$pdfUrl = $response->json('pdf_url');
The API is in early access; this is the documented call shape it opens with. Full request and response walkthrough.
§ 04
Questions about this job
Why does my dompdf PDF not match how the page looks in the browser?
What is the best dompdf alternative for Laravel?
Is dompdf still worth using in 2026?
Can I switch from dompdf without running my own browser?
Does dompdf keep a record of the PDFs it generates?
§ Index
More PDF and archiving tools
- Convert HTML to PDF
- Webpage to PDF
- Save webpage as PDF
- URL to PDF API
- Website archiving
- Screenshot API
- React to PDF
- Laravel HTML to PDF
- Vue to PDF
- Next.js PDF generator
- Angular to PDF
- Markdown to PDF API
- Django HTML to PDF
- Blazor HTML to PDF
- Spring Boot HTML to PDF
- Airtable to PDF
- Rails HTML to PDF
- PDF generator API
- Document generation API
- Bulk HTML to PDF
- Wayback Machine alternative
- Best HTML to PDF API
- DocRaptor alternative
- Puppeteer alternative
- Wkhtmltopdf alternative
- PDFShift alternative
- Urlbox alternative
- PDFCrowd alternative
- Api2Pdf alternative
- Browserless alternative
- APITemplate alternative
- CraftMyPDF alternative
- PDFMonkey alternative
- Gotenberg alternative
- GrabzIt alternative
- How it works
- Features
- Pricing
§ Early access
Get on the early-access list
The API opens to the list first, in order. Early access locks the planned launch rates for 12 months. No card required, launching soon.