At the time of this post, Cloudflare Workers does not support the idea of embedding Headless Chrome or wkhtmltopdf in its environment. Workers also does not the idea of running docker containers either. This may change in the future, but for now, if you built an application on top of workers and need to generate a PDF file, you’re kind of stuck.
API2PDF will easily work with Cloudflare Workers because we provide a REST API that you can call from your workers to generate the PDF. We run Headless Chrome behind the scenes and you can convert HTML to PDF or a URL to PDF. We also offer other commands such as merging PDFs together, screenshots of URLs, HTML to Docx, Office files to PDF, and thumbnailing PDFs / Office files.
All you need to get started is an API key which you can grab for free here: https://portal.api2pdf.com/register
Below you will find sample code that you can modify to create a Cloudflare Worker. Replace apiKey variable with the API key you acquired from above.
Full on documentation is available at https://www.api2pdf.com/documentation
Tags: cloudflare workers docx to pdf, cloudflare workers generate pdf, cloudflare workers headless chrome, cloudflare workers html to pdf, cloudflare workers libreoffice, cloudflare workers merge pdfs, cloudflare workers screenshot url, cloudflare workers thumbnail pdf, cloudflare workers url to image, cloudflare workers url to pdf, cloudflare workers wkhtmltopdf
Comments are closed.