fpdf2
Simple & fast PDF generation for Python
Decision gist · record as of 2026-08-14
Yes. fpdf2 is a mature, actively maintained library with low install friction (three lightweight dependencies), no known vulnerabilities, and broad Python version support (3.10+). It's well-suited for straightforward PDF generation tasks. The LGPL-3.0 copyleft license requires that derivative works remain open-source, which is a consideration for proprietary projects but not a barrier for most use cases.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Low friction: pure Python with only three runtime dependencies.
- Actively maintained with a release 5 days ago and 1535 GitHub stars.
License · maintenance · safety
LGPL-3.0-only (copyleft) — LGPL-3.0-only (copyleft): you may use and modify fpdf2 freely, but derivative works must also be licensed under LGPL-3.0 and source code must be available to users.
last release 2026-08-09 (5 days) · last repo commit 2026-08-14 · 1,535 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 19,110,259 downloads/mo, #1,074 on PyPI
Alternatives
Verify before relying
pip install fpdf2
from fpdf import FPDF
pdf = FPDF()
pdf.add_page()
pdf.set_font('helvetica', size=12)
pdf.cell(text="hello world")
pdf.output("hello_world.pdf")- Whether the library's performance characteristics (speed, memory usage) meet your specific document size or throughput requirements.
- Whether HTML-to-PDF conversion handles your particular HTML/CSS subset adequately.
- Specific use-case compatibility with Django, Flask, FastAPI, or other frameworks mentioned in the description.
What it is and what it does
fpdf2 is a pure-Python PDF generation library that lets you build PDF documents programmatically by adding pages, text, images, tables, and other content. It handles Unicode text with TrueType font embedding, supports internal and external links, can embed images with transparency, and includes features like barcodes, charts, document encryption, and basic HTML conversion. The library depends on Pillow for image handling, fonttools for font subsetting, and defusedxml for safe XML parsing.
It's designed to be fast and easy to learn, with a straightforward API: create a FPDF object, add pages, set fonts, write content, and output to a file. The project is mature and actively maintained, supporting Python 3.10 and later. It includes over 1300 unit tests and is widely used in web applications.
Use it for
- Generate invoices, receipts, or reports on-the-fly in web applications without external services.
- Batch-create templated PDFs (certificates, letters, forms) from data using the templating system.
- Embed images, barcodes, or charts into dynamically generated documents.
- Convert HTML content to PDF for archival or distribution.
- Add document encryption or digital signatures for secure PDF delivery.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
fpdf2 is a mature, actively maintained library with low install friction (three lightweight dependencies), no known vulnerabilities, and broad Python version support (3.10+). It's well-suited for straightforward PDF generation tasks. The LGPL-3.0 copyleft license requires that derivative works remain open-source, which is a consideration for proprietary projects but not a barrier for most use cases.
Install
fpdf2 on PyPI
Before you install
Low friction: pure Python with only three runtime dependencies. Actively maintained with a release 5 days ago and 1535 GitHub stars.
License in practice
LGPL-3.0-only (copyleft): you may use and modify fpdf2 freely, but derivative works must also be licensed under LGPL-3.0 and source code must be available to users.
Quickstart
pip install fpdf2
from fpdf import FPDF
pdf = FPDF()
pdf.add_page()
pdf.set_font('helvetica', size=12)
pdf.cell(text="hello world")
pdf.output("hello_world.pdf")
Verify before relying
- Whether the library's performance characteristics (speed, memory usage) meet your specific document size or throughput requirements.
- Whether HTML-to-PDF conversion handles your particular HTML/CSS subset adequately.
- Specific use-case compatibility with Django, Flask, FastAPI, or other frameworks mentioned in the description.
Package facts
| License | LGPL-3.0-only copyleft |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 3 packagesdefusedxmlPillowfonttools |
| Maintenance | Actively maintained 5 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 19,110,259 / month, #1,074 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Multimedia :: GraphicsTopic :: Multimedia :: Graphics :: PresentationTopic :: PrintingTopic :: Software Development :: Libraries :: Python ModulesTopic :: Text Processing :: Markup |
Evidence: fpdf2-2.8.8-py3-none-any.whl
Tags
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 › “generate pdf documents python”
- fpdf2fpdf2 generates PDF documents programmatically in Python, supporting…
- PyLaTeXPyLaTeX generates LaTeX documents and code snippets from Python,…
- xhtml2pdfConverts HTML and CSS to PDF documents using Python, enabling…
Give your agent the search over MCP, or paste the wish link into any chat.
More Python Modules packages
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.
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.
PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.
Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.
Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.
Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…
Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.
See also fpdf · types-fpdf2 · BrazilFiscalReport · unPDF · pdftext · pypdf · camelot-py · PyPDF2 · pymupdf-fonts · aspose-slides