I recently stumbled on wkhtmltopdf and have found it to be an excellent tool for on-the-fly conversion from html to pdf in the browser.
A typical usage (in Windows) woul
I couldn't get wkhtmltopdf
to work on my end converting raw html to PDF, but I did find a simple microservice that was able to do it with a couple minutes work on bantam.io.
Here's how it works:
bantam
.run('@images/html', {
html: `
TEST
`,
imageType: 'pdf',
})
.then(pdfUrl => {
// pdf is temporarily hosted on AWS S3 via a secure link at `pdfUrl`
});
They also have options for taking in a URL rather than raw HTML and you can produce images as well as PDFs. Here are the docs: https://bantam.io/functions/@images/html?link=docs&subLink=0