$npx skillfedfor your agent

pdfkit

Wkhtmltopdf python wrapper to convert html to pdf using the webkit rendering engine and qt

With conditionsPyPI UtilitiesReleased Nov 20217.8M downloads / moMITPure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — pdfkit-1.0.0-py2-none-any.whl · pdfkit-1.0.0-py3-none-any.whl
v1.0.0 · released 2021-11-14

Yes, if you need simple HTML-to-PDF conversion and are willing to manage the wkhtmltopdf system dependency. The package is stable and widely used, but dormant—no active maintenance since late 2023. Check the two known vulnerabilities before use in security-sensitive contexts. For new projects, consider whether a maintained alternative or headless-browser service better fits your risk tolerance.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • wkhtmltopdf binary must be installed separately on your system (via apt-get, brew, or direct download); pdfkit is only a Python wrapper and will not function without it.
  • Low install friction with no runtime dependencies.
  • However, the package is dormant—last release was 2021-11-14 and last commit 2023-10-26—so expect no active maintenance or updates for emerging issues.

License · maintenance · safety

MIT (permissive) — MIT license is permissive, allowing commercial and private use with minimal restrictions.

last release 2021-11-14 (1734 days) · last repo commit 2023-10-26 · 2,044 stars

2 known vulnerabilities (OSV.dev, 2026-08-14) · 7,782,391 downloads/mo, #1,696 on PyPI

Verify before relying

pip install pdfkit

import pdfkit

pdfkit.from_url('http://google.com', 'out.pdf')
pdfkit.from_file('test.html', 'out.pdf')
pdfkit.from_string('Hello!', 'out.pdf')
  • Current compatibility with modern Python versions beyond 3.9 (classifiers list 3.9 as latest)
  • Status of the two known vulnerabilities (GHSA-9g3x-6x24-vf9f, PYSEC-2026-2860) and whether they affect typical use
  • Whether Debian/Ubuntu wkhtmltopdf packages still have reduced functionality as documented
Same gist for agents: .md · .json

What it is and what it does

pdfkit is a thin Python wrapper around the wkhtmltopdf command-line tool, which uses the Webkit rendering engine to convert HTML into PDF files. It lets you generate PDFs from live URLs, local HTML files, or HTML strings passed directly to the API, with support for options like page size, margins, headers, footers, and table of contents. The package handles the subprocess plumbing and argument construction so you don't have to shell out to wkhtmltopdf manually.

The wrapper requires wkhtmltopdf to be installed as a separate system binary; pdfkit itself has no Python runtime dependencies. It supports both Python 2 and 3 (though Python 2 is long obsolete) and offers a simple three-function API: from_url(), from_file(), and from_string(). You can also retrieve the PDF as a byte string instead of writing to disk, and pass detailed configuration options via dictionaries.

Use it for

  • Generate PDF reports from HTML templates in a web application without relying on a headless browser service.
  • Batch-convert multiple HTML files or URLs to PDF for archival or distribution.
  • Create invoices or receipts by rendering HTML with CSS styling directly to PDF.
  • Embed PDF generation in a Python script that needs to produce documents from web content.
  • Add table of contents, headers, and footers to HTML-based documents during PDF export.

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

With conditions

Yes, if you need simple HTML-to-PDF conversion and are willing to manage the wkhtmltopdf system dependency.

The package is stable and widely used, but dormant—no active maintenance since late 2023. Check the two known vulnerabilities before use in security-sensitive contexts. For new projects, consider whether a maintained alternative or headless-browser service better fits your risk tolerance.

Install

pdfkit on PyPI

Before you install

Low install friction with no runtime dependencies. However, the package is dormant—last release was 2021-11-14 and last commit 2023-10-26—so expect no active maintenance or updates for emerging issues.

wkhtmltopdf binary must be installed separately on your system (via apt-get, brew, or direct download); pdfkit is only a Python wrapper and will not function without it.

License in practice

MIT license is permissive, allowing commercial and private use with minimal restrictions.

Quickstart

pip install pdfkit

import pdfkit

pdfkit.from_url('http://google.com', 'out.pdf')
pdfkit.from_file('test.html', 'out.pdf')
pdfkit.from_string('Hello!', 'out.pdf')

Verify before relying

  • Current compatibility with modern Python versions beyond 3.9 (classifiers list 3.9 as latest)
  • Status of the two known vulnerabilities (GHSA-9g3x-6x24-vf9f, PYSEC-2026-2860) and whether they affect typical use
  • Whether Debian/Ubuntu wkhtmltopdf packages still have reduced functionality as documented

Package facts

LicenseMIT permissive
Python supportNot specified
Install frictionLow. Pure-Python wheel
Runtime dependenciesNone
MaintenanceDormant 1,734 days since the last release
Last repo commit
First released
Downloads7,782,391 / month, #1,696 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilities2 GHSA-9g3x-6x24-vf9f, PYSEC-2026-2860
Classifiers
Programming Language :: PythonProgramming Language :: Python :: 2.7Programming Language :: Python :: 3.2Programming Language :: Python :: 3.3Programming Language :: Python :: 3.4Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Text ProcessingTopic :: Text Processing :: GeneralTopic :: Text Processing :: MarkupTopic :: Text Processing :: Markup :: HTMLTopic :: Text Processing :: Markup :: XMLTopic :: Utilities

Evidence: pdfkit-1.0.0-py2-none-any.whl; pdfkit-1.0.0-py3-none-any.whl

Tags

Capabilities
html to pdf conversionwkhtmltopdf python wrapperwebkit pdf generationconvert html string to pdfbatch html to pdfpdf from url pythonhtml file to pdf converter
Topics
pdf-generationhtml-conversionwebkit-rendering

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “webkit pdf generation”

  • pdfkitPython wrapper for wkhtmltopdf that converts HTML to PDF using the…
  • wkhtmltopdfWraps the wkhtmltopdf command-line tool to convert URLs and HTML to…
  • playwrightAutomate Chromium, Firefox, and WebKit browsers via a single Python…

Give your agent the search over MCP, or paste the wish link into any chat.

More Utilities packages

idna Worth it
PyPI · Python Modules · released Jun 2026

Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.

Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.

BSD-3-Clausepure Python · 3.9+
1.8Bdownloads / mo
charset-normalizer Worth it
PyPI · Utilities · released Aug 2026

Detects and normalizes text encoding from unknown or ambiguous sources, supporting all IANA character sets that Python's core library provides codecs for, with the ability to register custom codecs.

permissive licensepure Python · 3.7+
1.7Bdownloads / mo
setuptools Worth it
PyPI · Python Modules · released Aug 2026

Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.

MITpure Python · 3.10+
1.6Bdownloads / mo
pluggy Worth it
PyPI · Libraries · released May 2025

Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.

Install it if you're building an extensible application or framework.

MITpure Python · 3.9+aging
1.3Bdownloads / mo
Pygments Worth it
PyPI · Utilities · released Mar 2026

Pygments is a syntax highlighter that colorizes source code and text in over 500 languages and formats, outputting to HTML, LaTeX, RTF, SVG, images, or ANSI terminal sequences.

Install it if you need to display or transform source code.

BSD-2-Clausepure Python · 3.9+
1.3Bdownloads / mo
six With conditions
PyPI · Libraries · released Dec 2024

Six provides utility functions to write Python code that runs on both Python 2.7 and Python 3.3+, smoothing over language differences between the two versions.

MITpure Python
1.2Bdownloads / mo

See also django-wkhtmltopdf · imgkit · wkhtmltopdf · weasyprint · markdown-pdf · xhtml2pdf · md2pdf · fpdf · nokap · ghostscript