skillfed

fpdf

Simple PDF generation for Python

fpdf v1.7.2 3.1M downloads/30d#2,736 on PyPI911
Copyleft license LGPLv3+ DORMANT released

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 fpdf

uv

uv add fpdf

poetry

poetry add fpdf

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)Operating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 2.5Programming Language :: Python :: 2.6Programming Language :: Python :: 2.7Programming Language :: Python :: 3.2Programming Language :: Python :: 3.3Programming Language :: Python :: 3.4Topic :: Multimedia :: GraphicsTopic :: Software Development :: Libraries :: PHP ClassesTopic :: Software Development :: Libraries :: Python Modules

Tags

pdf generation pythoncreate pdf from pythonsimple pdf librarypython pdf writerbarcode pdf generationunicode pdf fontshtml to pdf python
pdf-generationlegacy-packagecopyleft-license

More Libraries packages