Skip to content


Fork me on GitHub

fpdf2 is a library for simple & fast PDF document generation in Python. It is a fork and the successor of PyFPDF (cf. history).

Latest Released Version: Pypi latest version

fpdf2 logo

from fpdf import FPDF

pdf = FPDF()
pdf.set_font('helvetica', size=12)
pdf.cell(txt="hello world")

Go try it now online in a Jupyter notebook: Open In Colab or Open In nbviewer

Main features

QPDF logo PDF Checker logo VeraPDF logo



From PyPI:

pip install fpdf2

To get the latest, unreleased, development version straight from the development branch of this repository:

pip install git+

Developement: check the dedicated documentation page.

Displaying deprecation warnings

DeprecationWarnings are not displayed by Python by default.

Hence, every time you use a newer version of fpdf2, we strongly encourage you to execute your scripts with the -Wd option (cf. documentation) in order to get warned about deprecated features used in your code.

This can also be enabled programmatically with warnings.simplefilter('default', DeprecationWarning).



For community support, please feel free to file an issue or open a discussion.

They use fpdf2

  • Undying Dusk : a video game in PDF format, with a gameplay based on exploration and logic puzzles, in the tradition of dungeon crawlers
  • OpenDroneMap : a command line toolkit for processing aerial drone imagery
  • OpenSfM : a Structure from Motion library, serving as a processing pipeline for reconstructing camera poses and 3D scenes from multiple images
  • RPA Framework : libraries and tools for Robotic Process Automation (RPA), designed to be used with both Robot Framework
  • Concordia : a platform developed by the US Library of Congress for crowdsourcing transcription and tagging of text in digitized images
  • wudududu/extract-video-ppt : create a one-page-per-frame PDF from a video or PPT file. fpdf2 also has a demo script to convert a GIF into a one-page-per-frame PDF:
  • csv2pdf : convert CSV files to PDF files easily