---
id: wkhtmltopdf
version: "0.2"
license: BSD
license_treatment: permissive
maintenance: abandoned
---
# wkhtmltopdf — Simple python wrapper for wkhtmltopdf
License: permissive · Maintenance: abandoned · Downloads: 98.4K/mo
## What it is and what it does
python-wkhtmltopdf is a Python wrapper around the wkhtmltopdf command-line utility, which uses a headless WebKit renderer to convert web pages and HTML to PDF. It exposes wkhtmltopdf's rendering capabilities through a Python class and function interface, allowing you to specify a URL or HTML content, configure rendering options like screen_resolution, color_depth, dpi, orientation, and write the resulting PDF to a file.
The package includes optional Flash plugin support and can be used as a class, a function, a command-line tool, or an HTTP API. However, it has been abandoned since 2011 and requires substantial system-level setup: you must install Xvfb, wkhtmltopdf itself, system fonts, and flashplugin-nonfree before the Python package can run. No runtime Python dependencies are declared.
Use it for:
- Generate PDFs from live web pages or HTML templates in legacy Python 2 applications
- Batch convert URLs to PDF files with customizable rendering parameters like dpi and orientation
- Render web content with Flash animations to PDF using the flash_plugin option
- Expose PDF generation as an HTTP API endpoint via the built-in API server
## Worth the install?
AI-flagged interpretation of the facts above — verify before relying.
Wraps the wkhtmltopdf command-line tool to convert URLs and HTML to PDF from Python, with optional Flash rendering support.
No. The package is abandoned (last release 2011-07-21, repository archived) and targets python 2.5+, which is long out of support. Install only if maintaining legacy Python 2 code already using this package. The system-level dependency burden, high install friction, and lack of maintenance make it unsuitable for new projects.
## Install
pip install wkhtmltopdf
uv add wkhtmltopdf
poetry add wkhtmltopdf
## Installing wkhtmltopdf
Before you install: High install friction: requires system-level dependencies (Xvfb, wkhtmltopdf, fonts, flashplugin-nonfree) to be installed separately before the Python package can function. Package is abandoned since 2011 with no maintenance activity.
License in practice: BSD license is permissive and poses no restrictions on use, modification, or distribution.
Quickstart:
from wkhtmltopdf import WKHtmlToPdf
wkhtmltopdf = WKHtmlToPdf(
url='http://www.example.com',
output_file='~/example.pdf',
)
wkhtmltopdf.render()
Requires system installation of Xvfb, wkhtmltopdf, xfonts-100dpi xfonts-75dpi xfonts-scalable xfonts-cyrillic, and flashplugin-nonfree before the Python package can function.
Verify before relying:
- Whether the package works with Python versions beyond 2.5–2.7
- Current compatibility with modern wkhtmltopdf versions and contemporary Linux distributions
- Whether Flash plugin dependency remains relevant or is a legacy artifact
## Package facts
- License: BSD (permissive)
- Python support: unspecified
- Install friction: high
- Maintenance: abandoned
- Downloads: 98.4K/month (top 15,000 on PyPI)
- Known vulnerabilities: none known
## Tags
convert url to pdf python, html to pdf wrapper, wkhtmltopdf python, web page pdf generation, render html as pdf, pdf-generation, legacy-python2, abandoned
[View on SkillFed](https://skillfed.io/packages/wkhtmltopdf) · [View on PyPI](https://pypi.org/project/wkhtmltopdf/)