fpdf2

2.8.7 · active · verified Thu Apr 09

fpdf2 is a simple and fast Python library for generating PDF documents, actively maintained as a modern fork of the original FPDF. It supports a wide range of features including text, images, shapes, tables, and SVG rendering. The current version is 2.8.7, and it has a rapid release cadence with frequent updates adding new features and bug fixes.

Warnings

Install

Imports

Quickstart

This quickstart code generates a simple PDF document named 'hello_world.pdf' containing the text 'Hello, World!' using the FPDF class.

from fpdf import FPDF

pdf = FPDF()
pdf.add_page()
pdf.set_font("helvetica", size=12)
pdf.cell(txt="Hello, World!")
pdf.output("hello_world.pdf")

view raw JSON →