A wkhtmltopdf alternative with modern CSS.
Flexbox, grid and web fonts that render the way your browser shows them, without an unmaintained binary on your servers.
With wkhtmltopdfA binary on your server
wkhtmltopdf --page-size A4 \ --margin-top 18mm --margin-bottom 18mm \ invoice.html invoice.pdf # Then: template the HTML yourself, store the PDF, # and email it with another service.
With TemplaterOne request, email and PDF
await fetch("https://templater.nestutils.com/v1/emails/send", {
method: "POST",
headers: {
Authorization: "Bearer " + process.env.TEMPLATER_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({
template: "invoice-email",
to: [invoice.customer_email],
data: invoice,
attachments: [{ template: "gst-invoice" }],
}),
});What changes when you switch.
| Concern | wkhtmltopdf | Templater |
|---|---|---|
| Rendering engine | An old WebKit fork | Current Chrome |
| Flexbox, grid and modern CSS | Partial or missing | Supported |
| Maintenance | Repository archived in 2023 | Maintained service |
| Template engine | Bring your own | Handlebars with helpers |
| Sending the email | Second service | Same request |
When wkhtmltopdf is still the right call
If your layouts are simple, already work, and must run on a machine with no network access, a local binary you already know can be enough.
When Templater fits better
If your CSS uses flexbox or grid, or you want previews, versions and the email in one place, a current engine behind one API saves the workarounds.
Other comparisons
Templater vs PuppeteerKeep your HTML. Drop the headless browser, the memory spikes and the separate email service.Templater vs DocRaptorRender the PDF and deliver the email that carries it from one template, one request and one set of data.Templater vs PDFMonkeyCode-first templates for PDFs and emails, with the send and the attachment in the same call.Templater vs SendGrid templatesKeep Handlebars. Add a rendered invoice, receipt or statement to every email without a second rendering service.
Product names are trademarks of their respective owners.