The Python SDK provides API clients for converting HTML, PDF, and images. It supports Python 2.7 and Python 3 and has no third-party runtime dependencies.
python -m pip install pdfcrowdSee the Python documentation for authentication, conversion examples, and API references.
Starting with version 7.0.1, status and reason codes parsed from API errors
are integers. Compare error.getStatusCode() with 400, rather than
"400"; use integer comparisons for error.getReasonCode() too.
An error without a supplied or parsed status retains None, and an error
without a parsed reason retains -1. Error messages and string output
are preserved.
Starting with version 7.0.0, this package contains only the Python API. The
html2pdf, html2image, image2pdf, image2image, pdf2pdf, pdf2html,
pdf2text, and pdf2image commands are provided by pdfcrowd-cli.
The CLI requires Python 3.8 or later; the SDK continues to support Python 2.7.
Install the CLI with pipx:
pipx install pdfcrowd-cli
html2pdf --helpOr install it in your Python virtual environment:
python -m pip install pdfcrowd-cli
html2pdf --helpThe CLI installs a compatible SDK automatically. Python applications that
import pdfcrowd continue to use the API clients directly.