Skip to main content

Simple & fast PDF generation for Python

Project description

Pypi latest version Python Support License: LGPL v3

build status codecov security: bandit, pylint, semgrep

Dependents Downloads per month Contributors GitHub last commit

issues closed PRs closed Pull Requests Welcome first-timers-only Friendly โ†’ come look at our good first issues

fpdf2

fpdf2 logo

fpdf2 is a PDF creation library for Python:

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")

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

Compared with other PDF libraries, fpdf2 is fast, versatile, easy to learn and to extend (example). It is also entirely written in Python and has very few dependencies: Pillow, defusedxml, & fontTools. It is a fork and the successor of PyFPDF (cf. history).

Development status: this project is mature and actively maintained.

We are looking for contributing developers: if you want to get involved but don't know how, or would like to volunteer helping maintain this lib, open a discussion!

Installation Instructions

pip install fpdf2

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

pip install git+https://github.com/PyFPDF/fpdf2.git@master

Features

Our 350+ reference PDF test files, generated by fpdf2, are validated using 3 different checkers:

QPDF logo PDF Checker logo VeraPDF logo

Please show the value

Choosing a project dependency can be difficult. We need to ensure stability and maintainability of our projects. Surveys show that GitHub stars count play an important factor when assessing library quality.

โญ Please give this repository a star. It takes seconds and will help your fellow developers! โญ

Please share with the community

This library relies on community interactions. Please consider sharing a post about fpdf2 and the value it provides ๐Ÿ˜Š

GitHub Repo stars GitHub Repo stars GitHub Repo stars GitHub Repo stars GitHub Repo stars

Documentation

You can also have a look at the tests/, they're great usage examples!

Developement

Please check the dedicated documentation page.

Contributors โœจ

This library could only exist thanks to the dedication of many volunteers around the world:

Mariano Reingart
Mariano Reingart

๐Ÿ’ป
David Ankin
David Ankin

๐Ÿ› ๐Ÿ’ป ๐Ÿ“– ๐Ÿšง ๐Ÿ’ฌ ๐Ÿ‘€ โš ๏ธ
Alex Pavlovich
Alex Pavlovich

๐Ÿ› ๐Ÿ’ป ๐Ÿ“– ๐Ÿ’ฌ ๐Ÿ‘€ โš ๏ธ
Lucas Cimon
Lucas Cimon

๐Ÿ“ ๐Ÿ’ป ๐Ÿ“– ๐Ÿš‡ ๐Ÿšง ๐Ÿ’ฌ
Miroslav ล edivรฝ
Miroslav ล edivรฝ

๐Ÿ’ป โš ๏ธ
Florian Bernhart
Florian Bernhart

๐Ÿ’ป โš ๏ธ
Edwood Ocasio
Edwood Ocasio

๐Ÿ’ป โš ๏ธ
Marcelo Duarte
Marcelo Duarte

๐Ÿ’ป
Roman Kharin
Roman Kharin

๐Ÿ’ป ๐Ÿค”
Christopher Frost
Christopher Frost

๐Ÿ› ๐Ÿ’ป
Michael Kalbermatten
Michael Kalbermatten

๐Ÿ› ๐Ÿ’ป
Yanone
Yanone

๐Ÿ’ป
Leo Zhu
Leo Zhu

๐Ÿ’ป
Abishek Goda
Abishek Goda

๐Ÿ’ป
Arthur Moore
Arthur Moore

๐Ÿ’ป โš ๏ธ ๐Ÿ›
Bogdan Cuza
Bogdan Cuza

๐Ÿ’ป
Craig Hobbs
Craig Hobbs

๐Ÿ’ป
xitrushiy
xitrushiy

๐Ÿ› ๐Ÿ’ป
Josรฉ L. Redrejo Rodrรญguez
Josรฉ L. Redrejo Rodrรญguez

๐Ÿ’ป
Jรผrgen Gmach
Jรผrgen Gmach

๐Ÿ’ป
Larivact
Larivact

๐Ÿ’ป
Leonel Cรขmara
Leonel Cรขmara

๐Ÿ’ป
Mark Steadman
Mark Steadman

๐Ÿ› ๐Ÿ’ป
Sergey
Sergey

๐Ÿ’ป
Stan-C421
Stan-C421

๐Ÿ’ป
Viraj Shah
Viraj Shah

๐Ÿ’ป
cornicis
cornicis

๐Ÿ’ป
moe-25
moe-25

๐Ÿ’ป ๐Ÿ‘€ ๐Ÿ”ฌ ๐Ÿ›
Simone Bizzotto
Simone Bizzotto

๐Ÿ’ป
Boonyawe Sirimaha
Boonyawe Sirimaha

๐Ÿ›
T
T

๐Ÿ’ป ๐ŸŽจ
AubsUK
AubsUK

๐Ÿ’ฌ
Georg Mischler
Georg Mischler

๐Ÿ› ๐Ÿ’ป ๐ŸŽจ ๐Ÿ“– ๐Ÿค” ๐Ÿ’ฌ โš ๏ธ
ping
ping

๐Ÿ›
Portfedh
Portfedh

๐Ÿ“– โœ…
Tabarnhack
Tabarnhack

๐Ÿ’ป
Mridul Birla
Mridul Birla

๐ŸŒ
digidigital
digidigital

๐ŸŒ
Xit
Xit

๐ŸŒ
Alexander Burchenko
Alexander Burchenko

๐ŸŒ
Andrรฉ Assunรงรฃo
Andrรฉ Assunรงรฃo

๐ŸŒ
Quentin Brault
Quentin Brault

๐ŸŒ
Paula Campigotto
Paula Campigotto

๐Ÿ› ๐Ÿ’ป ๐Ÿ‘€
bettman-latin
bettman-latin

๐Ÿ’ป
oleksii-shyman
oleksii-shyman

๐Ÿ’ป ๐ŸŽจ ๐Ÿค”
lcomrade
lcomrade

๐Ÿ“– ๐Ÿ› ๐Ÿ’ป
pwt
pwt

๐Ÿ› ๐Ÿ’ป
Martin Cerveny
Martin Cerveny

๐Ÿ› ๐Ÿ’ป
Spenhouet
Spenhouet

๐Ÿ› ๐Ÿ‘€
mtkumar123
mtkumar123

๐Ÿ’ป
Davide Consalvo
Davide Consalvo

๐Ÿ’ป ๐Ÿ’ฌ ๐ŸŽจ
Bruno Santos
Bruno Santos

๐Ÿ›
cgkoutzigiannis
cgkoutzigiannis

โš ๏ธ
I Wayan Kurniawan
I Wayan Kurniawan

๐Ÿ“–
Sven Eliasson
Sven Eliasson

๐Ÿ“–
gonzalobarbaran
gonzalobarbaran

๐Ÿ’ป
Nuttapat Koonarangsri
Nuttapat Koonarangsri

๐Ÿ“– ๐Ÿ›
Sokratis Vasiliou
Sokratis Vasiliou

๐ŸŒ
semaeostomea
semaeostomea

๐Ÿ“– ๐Ÿ’ป
Josuรฉ Millรกn Zamora
Josuรฉ Millรกn Zamora

๐Ÿ’ป
me-suzy
me-suzy

๐Ÿ›
dmail00
dmail00

๐Ÿ›
Gerardo Allende
Gerardo Allende

๐Ÿ’ป
Nicholas Jin
Nicholas Jin

๐Ÿ›
Yusuke
Yusuke

๐Ÿ’ป
Tillrzhtgrfho
Tillrzhtgrfho

๐Ÿ›
Dario Ackermann
Dario Ackermann

๐Ÿ›
Tzvi Greenfeld
Tzvi Greenfeld

๐Ÿ“–
devdev29
devdev29

๐Ÿ“– ๐Ÿ’ป
Johan Bonneau
Johan Bonneau

๐Ÿ“–
Jesรบs Alberto Muรฑoz Mesa
Jesรบs Alberto Muรฑoz Mesa

โš ๏ธ ๐Ÿ“–
Jaydeep Das
Jaydeep Das

๐Ÿ’ฌ
Sean
Sean

๐Ÿ’ป
Anderson Herzogenrath da Costa
Anderson Herzogenrath da Costa

๐Ÿ’ฌ ๐Ÿ’ป ๐Ÿ”ฌ ๐Ÿ› ๐Ÿ“– ๐Ÿค”
Yi Wei Lan
Yi Wei Lan

โš ๏ธ
CpDong
CpDong

๐Ÿ’ป ๐Ÿ› ๐ŸŒ
CY-Qiu
CY-Qiu

๐Ÿ›
Markovvn1
Markovvn1

๐Ÿ’ป
Elad Rapaport
Elad Rapaport

๐Ÿ’ป
SfinxV
SfinxV

๐Ÿ›
bramantoleksono
bramantoleksono

๐Ÿ›
TheNerdy907
TheNerdy907

๐Ÿ›
Elie Roux
Elie Roux

๐Ÿ› ๐Ÿค” ๐Ÿ’ป ๐Ÿ’ฌ
msalem
msalem

๐Ÿ“–
Manuel Ruiz
Manuel Ruiz

๐Ÿ›
Noel
Noel

๐Ÿ›
Avik Sarkar
Avik Sarkar

๐ŸŒ ๐Ÿ“– ๐Ÿ’ฌ
aeris07
aeris07

๐Ÿ›
KamarulAdha
KamarulAdha

๐Ÿ“–
Valerus5685
Valerus5685

๐Ÿ›
Sebastian Tia
Sebastian Tia

๐Ÿ’ป
Eugene Selifonov
Eugene Selifonov

๐Ÿ›
Kuth
Kuth

๐ŸŒ
Ruben de Bruin
Ruben de Bruin

๐Ÿ› ๐Ÿ’ป ๐Ÿ“–
stenci
stenci

๐Ÿ›
alcnaka
alcnaka

๐ŸŒ
Tolker-KU
Tolker-KU

๐Ÿ’ป
lfavole
lfavole

๐Ÿ’ป

This project follows the all-contributors specification (emoji key). Contributions of any kind welcome!

Contributors map

(screenshot from January 2023, click on the map above to access an up-to-date online version)

Community, related tools, alternative libraries

More about those in the documentation.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fpdf2-2.7.5.tar.gz (195.4 kB view hashes)

Uploaded source

Built Distribution

fpdf2-2.7.5-py2.py3-none-any.whl (173.1 kB view hashes)

Uploaded py2 py3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page