HTML-to-PDF with Python
DocRaptor Python Native Client Library
pip install --upgrade docraptor
easy_install --upgrade docraptor
See examples for runnable examples with file output, error handling, etc.
Docs created like this are limited to 60 seconds to render, check out the async example which allows 10 minutes.
We have guides for doing some of the common things:
Converting HTML into PDF and XLS documents with Python is fast and painless with DocRaptor. Just POST to our Docs API with your HTML content and some required parameters, either as a form serialized string or a JSON object.
Below you’ll find complete examples for Python, but our API Reference Guide has all the details about the complete workings of the Docs API.
With DocRaptor, your PDF content is HTML and its style is CSS - things you already know! Even still, it can be difficult to get your PDF to look just right. Check out our Style and Formatting Documentation for everything related getting a perfectly styled PDF!