DocRaptor vs wkhtmltopdf (and Snappy)

Historically, wkhtmltopdf was an excellent open-source HTML-to-PDF tool. It is one of the few open-source projects built solely for HTML-to-PDF generation and uses a specifically modified version of the WebKit browser engine.

Note: After this article was originally published, Headless Chrome was released with more modern CSS and JavaScript rendering. We have a new article about open-source HTML to PDF libraries with more up-to-date information.

wkhtmltopdf is used inside many popular language-specific tools such as PHP’s Snappy, wicked_pdf and pdfkit.

wkhtmltopdf is an excellent solution for many, but not all, projects. Here’s what you should consider when choosing between DocRaptor and wkhtmltopdf:

  1. Is document size or complexity important? Generally speaking, we’ve found wkhtmltopdf generates documents 15-40% larger than the same document created by DocRaptor. In rare cases, especially with more complex documents, wkhtmltopdf produces documents that are significantly larger. As an example, wkhtmltopdf turns into a 4MB, CPU-hogging PDF file whereas DocRaptor outputs a 160kb file. Winner: DocRaptor
  2. Are you sending the document to a printer? We make it easy to send your PDFs right to your printer. DocRaptor has support for CSS3 page media queries and PDF/A-1B ISO standards. It’s easy to add features like page numbers, headers and footers, and customized page sizes with a simple change to your CSS styling. wkhtmltopdf offers similar features, but requires using configuration setting. This requires you to make style definitions in your backend code and CSS, as opposed to just in your CSS. If you’re intending to print your documents, we suggest closely comparing the documents generated by the various services. Winner: DocRaptor, but it’s close
  3. Do you want PDF forms or document thumbnails? Both of these features are supported by wkhtmltopdf, but not DocRaptor. Winner: wkhtmltopdf
  4. Do you also need to create XLS files? DocRaptor handles both PDFs and XLS files. Winner: DocRaptor
  5. Do you want to maintain your own architecture? This is the largest difference between wkhtmltopdf and DocRaptor. With wkhtmltopdf, each document takes up far more server capacity than a normal web page load. DocRaptor provides proven architecture capable of handling millions of documents a month without requiring additional server capacity.

    When you choose DocRaptor, you get direct access to a highly experienced support team to assist with your implementation and help debug any problems with your generated documents. Be sure to compare the architecture setup and support costs. The results might surprise you! Winner: DocRaptor (in most cases, but not always)

We hope this document helps. If you have further questions, please leave a comment or email!

Ready to get started? Try DocRaptor for free with unlimited test documents.