Convert HTML to PDF Like a Boss Using DocRaptor

Get started learning Python with DataCamp's free Intro to Python tutorial. Learn Data Science by completing interactive coding challenges and watching videos by expert instructors. Start Now!

is an awesome Python package which allows you to convert your HTML document to PDF. It works with Python 2 and Python 3.

Here are some features of DocRaptor:

  1. Support any size document, with simple, per-document pricing
  2. Supports layout and sizing changes on a per-page basis
  3. Asynchronous document generation, for long or large documents
  4. 99.99% uptime guarantee

Installing DocRaptor

To install DocRaptor using pip type the following command:

You can also use easy_intall :

Creating PDFs

Creating PDF from your HTML document is quite simple just post your HTML to DocRaptor and you will get the response as text/plain .

Run the script and it will create a pdf file named output.pdf .

The preceding code generates PDF synchronously. Here is how you can generate PDFs asynchronously:

Other Tutorials

This site generously supported by DataCamp. DataCamp offers online interactive Python Tutorials for Data Science. Join over a million other learners and get started learning Python for data science today!

Leave a Reply

Be the First to Comment!

Notify of