

You should review all your potential solutions. That said, many DocRaptor users have tried an open-source tool before switching to DocRaptor. We thought we could help other developers from wasting time and energy as we did. In the end, our own difficulties with creating a high-quality PDF and scaling production led us to create DocRaptor. If you want to generate a lot of documents or support simultaneous PDF creation, scalability planning will be required. If your usage numbers are small, this may not be a concern. Background jobs are the common solution (it's what we do). If it crashes, it will restart automatically.Īs of this writing, headless Chrome uses about 65mb of RAM while idle. It's suggested to use pm2 to ensure Chrome continues to run. There is significant overhead starting up Chrome for each PDF generation which can be easily avoided. Note: It is strongly recommended that you keep Chrome running side-by-side with Node.js. A popular Node-based open-source HTML to PDF library notes in the readme: There is also larger startup times, CPU usage, and memory consumption to consider.

#PDFKIT VS PHANTOMJS HOW TO#
Learn how to adjust styling with basic HTML and CSS. With enough effort and polyfills, slightly more complex documents can be supported.Ĭonsistency and clarity for PDF and Excel documents can be yours with DocRaptor. They’re great for one-page invoices, simple letters, or exact copies of existing webpages. If you don’t need any of that functionality, the open-source tools may be a good solution for your document. Tables or images spanning multiple pages.This one fact, along with a dedicated focus on PDFs, means Prince’s commercial HTML to PDF engine has far superior support for common requirements such as: When there isn't even a concept of a “page”, repeating elements such as headers or watermarks aren’t supported. So why did we build the DocRaptor HTML-to-PDF API on top of the PrinceXML commercial engine? After struggling with weeks with open-source libraries, we realized there is a significant technical gap between Prince and all the browser-based HTML-to-PDF libraries:īrowsers assume you’re making a long scrolling webpage.
