mkdocs-with-pdf
Generate a single PDF file from MkDocs repository
What it is and what it does
mkdocs-with-pdf is a plugin for MkDocs that converts your entire documentation site into a single PDF file during the build process. It uses weasyprint as its rendering engine and automatically generates a cover page, table of contents, and heading numbers (h1–h3) in the output. The plugin integrates directly into MkDocs' build pipeline—you enable it in your mkdocs.yml configuration and it runs when you execute mkdocs build.
The package is designed for documentation teams who need to distribute their docs as a single PDF artifact. It offers customization options for cover pages, table of contents depth, heading numbering levels, and page exclusions. However, the project is dormant—the last release was in July 2021 and there have been no commits since May 2024. This means it may not be actively maintained for compatibility with newer MkDocs or Python versions.
Use it for:
- Export a complete MkDocs documentation site as a single PDF for offline distribution or archival.
- Generate PDF documentation automatically as part of a CI/CD pipeline for release artifacts.
- Create printable versions of technical documentation with automatic table of contents and cover pages.
- Customize PDF output with cover logos, author metadata, and multi-column layouts for specific branding needs.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Generates a single PDF file from an MkDocs documentation site, with automatic table of contents, cover page, and heading numbering.
Yes, with conditions. Install it if you need PDF export from MkDocs and are willing to accept dormant maintenance. The package is stable and has no known vulnerabilities, but you should verify compatibility with your specific MkDocs and Python versions before relying on it in production. Be prepared to manage weasyprint's system-level dependencies (cairo, Pango, GDK-PixBuf) on your build platform.
Install
mkdocs-with-pdf on PyPI
pip
pip install mkdocs-with-pdfuv
uv add mkdocs-with-pdfpoetry
poetry add mkdocs-with-pdfInstalling mkdocs-with-pdf
Before you install
Low install friction with a wheel distribution. Maintenance is dormant—last release was 2021-07-03 and no commits since 2024-05-25. The package depends on weasyprint, which requires system libraries (cairo, Pango, GDK-PixBuf) to be installed separately on your platform.
License in practice
MIT license is permissive, allowing commercial and private use with minimal restrictions. You must retain the license notice in distributions.
Quickstart
pip install mkdocs-with-pdf
# In mkdocs.yml:
plugins:
- with-pdf
# Then run:
mkdocs build
WeasyPrint requires cairo, Pango, and GDK-PixBuf system libraries installed separately for your platform (Linux, macOS, or Windows). Python 3.6 or higher and MkDocs 1.0+ are required.
Verify before relying
- Whether the package works reliably with current MkDocs versions (last release 2021-07-03, no recent maintenance signal)
- Compatibility with modern Python versions beyond 3.9 (classifiers only list up to 3.9)
- Performance impact on large documentation sites during PDF generation
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.6) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 4 — mkdocs, weasyprint, beautifulsoup4, libsass |
| Maintenance | dormant — 1,868 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 342,684/month — #7,395 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: mkdocs_with_pdf-0.9.3-py3-none-any.whl
Keywords: mkdocs, pdf, weasyprint
Tags
More Documentation packages
Docutils converts plaintext documentation in…
unclear · top 1,000 on PyPI
SphinxSphinx generates professional documentation…
permissive · top 1,000 on PyPI
griffeGriffe extracts the complete structure and…
permissive · top 1,000 on PyPI
sphinxcontrib-serializinghtmlA Sphinx extension that outputs documentation…
permissive · top 1,000 on PyPI
alabasterAlabaster is a clean, responsive Sphinx theme…
permissive · top 1,000 on PyPI
sphinxcontrib-htmlhelpA Sphinx extension that generates HTML help…
permissive · top 1,000 on PyPI
mkdocs-print-site-pluginMkDocs plugin that generates a combined print…
permissive · top 15,000 on PyPI
mkdocs-videoA MkDocs plugin that embeds videos in…
permissive · top 15,000 on PyPI
mkdocs-open-in-new-tabA MkDocs plugin that injects JavaScript to…
permissive · top 15,000 on PyPI
mkdocstringsAn MkDocs plugin that automatically generates…
permissive · top 5,000 on PyPI
mkdocs-autorefsA MkDocs plugin that automatically creates…
permissive · top 5,000 on PyPI
mkdocs-monorepo-pluginEnables building multiple sets of documentation…
permissive · top 5,000 on PyPI
django-weasyprintProvides Django class-based views and response…
permissive · top 15,000 on PyPI
mkdocs-clickGenerates API documentation for Click…
permissive · top 5,000 on PyPI
mkdocs-multirepo-pluginMerges documentation from multiple Git…
permissive · top 15,000 on PyPI
mkdocs-git-revision-date-pluginAdds a Git-based revision date to MkDocs…
permissive · top 15,000 on PyPI