wkhtmltopdf is an open source library for converting HTML and URLs to PDF files. The advantage of this is that it is free to use. The problem is that often working with wkhtmltopdf in code can be challenging. Your developer environment needs to have the local libary / .exe installed properly. Often when deploying to production, like a web app in a cloud infrastructure, you have to jump through a dozen hoops that can take two or three days to get figured out.
Additionally, if you are trying to run PDFs at scale, you will hit a wall as we detailed in our medium post for why we built api2pdf.com. If you really want to scale your PDFs infinitely, you need to get it running on AWS Lambda or some other serverless architecture. This of course is very difficult to accomplish.
If the hassle of dealing with wkhtmltopdf directly is not your problem, and you still want to get off of it. The next best free alternative is Headless Chrome. It’s the new kid on the block. But you will have to face the same issues of dealing with the local developer environment, configuration, etc, etc.
This is why, at Api2Pdf.com, we built a REST API for wkhtmltopdf and a REST API for Headless Chrome – it is not an alternative to these libraries, but a wrapper. These are the tools you already know and love and that are supported by the community.