fpdf
Simple PDF generation for Python
What it is and what it does
PyFPDF is a lightweight PDF generation library ported from the PHP FPDF project. It lets you create PDF documents programmatically by adding text, images (PNG, GIF, JPG), barcodes (I2of5, code39), and Unicode-encoded TrueType fonts to pages. The library is designed to be simple and easy to extend, with no external runtime dependencies for core PDF and image generation.
The package includes basic HTML-to-PDF conversion and template support with a visual designer. It was originally built for Python 2.5–2.7 and has experimental Python 3 support, though the last release was in 2015 and the project is now dormant. It is suitable for straightforward PDF generation tasks but may require careful testing on modern Python versions.
Use it for:
- Generate invoices, receipts, or reports as PDF files from application data.
- Embed barcodes or QR codes in PDF documents for inventory or shipping labels.
- Convert simple HTML content to PDF for archival or distribution.
- Create templated PDF documents with dynamic text and images.
- Build PDF exports for web applications without relying on external PDF services.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Generates PDF documents from Python code, supporting text, images, barcodes, Unicode fonts, and basic HTML-to-PDF conversion without external runtime dependencies.
Yes, if you need simple PDF generation on Python 2.7 or are willing to test thoroughly on Python 3. No, if you require active maintenance, modern Python 3 support guarantees, or production-grade reliability. The copyleft LGPLv3+ license is a blocker for proprietary closed-source projects.
Install
fpdf on PyPI
pip
pip install fpdfuv
uv add fpdfpoetry
poetry add fpdfInstalling fpdf
Before you install
High install friction: the package distributes Windows installers alongside source, suggesting historical platform-specific build complexity. Dormant since 2015; last commit August 2024 shows minimal ongoing maintenance despite 911 GitHub stars.
License in practice
Licensed under LGPLv3+, a copyleft license requiring derivative works to be distributed under the same or compatible terms. Suitable for open-source projects but imposes obligations on proprietary use.
Quickstart
pip install fpdf
from fpdf import FPDF
pdf = FPDF()
pdf.add_page()
pdf.set_font('Arial', 'B')
pdf.cell(0, 'Hello World')
pdf.output('output.pdf')
Package targets Python 2.5–2.7 with experimental Python 3 support; modern Python 3 compatibility is uncertain.
Verify before relying
- Whether Python 3 support is production-ready or remains experimental as of version 1.7.2.
- Current status of PIL/Pillow dependency for GIF support and whether it is optional or required.
- Whether the package works reliably on modern Python versions given the 2015 release date.
Package facts
| License | LGPLv3+ (copyleft) |
| Python support | not specified |
| Install friction | high — source build required |
| Runtime dependencies | none |
| Maintenance | dormant — 4,223 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 3,133,937/month — #2,736 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: fpdf-1.7.2.tar.gz; fpdf-1.7.2.win32.exe; fpdf-1.7.2.win-amd64.exe
Keywords: pdf, unicode, png, jpg, ttf
Tags
More Libraries packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
python-dateutilProvides parsing, arithmetic, and recurrence…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
fpdf2fpdf2 generates PDF documents programmatically…
copyleft · top 5,000 on PyPI
img2pdfConverts raster images to PDF without…
copyleft · top 5,000 on PyPI
PyRTF3PyRTF3 generates Rich Text Format (RTF)…
copyleft · top 15,000 on PyPI
wkhtmltopdfWraps the wkhtmltopdf command-line tool to…
permissive · top 15,000 on PyPI
django-wkhtmltopdfWraps the wkhtmltopdf binary to convert HTML to…
permissive · top 15,000 on PyPI
gotenberg-clientA fully-typed Python client for the Gotenberg…
copyleft · top 15,000 on PyPI
pdf2imageConverts PDF files to PIL Image objects by…
permissive · top 1,000 on PyPI
typstCompiles Typst markup documents to PDF, PNG,…
unclear · top 15,000 on PyPI
unPDFExtracts individual characters and metadata…
permissive · top 15,000 on PyPI
pdf417genEncodes text and binary data into PDF417 2D…
permissive · top 15,000 on PyPI