PyFPDF (Original fpdf Library)

1.7.2 · abandoned · verified Thu Apr 09

PyFPDF is the original Python library for generating PDF documents, ported from the PHP FPDF project. Its last release (1.7.2) was in January 2015, and it is largely unmaintained. While it provides basic PDF creation functionalities like text, images (JPEG, PNG, GIF), and simple layouts, it is generally considered a legacy library. For active development and modern Python compatibility, its successor, fpdf2, is recommended.

Warnings

Install

Imports

Quickstart

This basic example creates a PDF document named 'hello_world.pdf' with a single page, sets the font to Arial bold 16, and prints 'Hello World!' at the default position.

from fpdf import FPDF

pdf = FPDF()
pdf.add_page()
pdf.set_font('Arial', 'B', 16)
pdf.cell(40, 10, 'Hello World!')
pdf.output('hello_world.pdf')

view raw JSON →