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(text="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/py-pdf/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!

Development

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

💻
Nicolai Wolfrom
Nicolai Wolfrom

🐛
Sandra
Sandra

🤔 💻
navitho
navitho

🐛
Sai Harsha Kottapalli
Sai Harsha Kottapalli

💻
Rakesh N J
Rakesh N J

📖
rodos
rodos

🐛
Ted Brookings
Ted Brookings

💻
Andy Friedman
Andy Friedman

💻
Matt
Matt

📖
matipos2
matipos2

📖
lry12138
lry12138

🌍
Martijn Jasperse
Martijn Jasperse

🐛 💻
demiurgepy
demiurgepy

🐛
Marek Tovlin
Marek Tovlin

💻
Polderrider
Polderrider

🌍
Elena ``of Valhalla''
Elena ``of Valhalla''

⚠️
Niall O'Callaghan
Niall O'Callaghan

🐛
jsid72
jsid72

🐛
Alan Collins
Alan Collins

💻
hyperstown
hyperstown

🖋
Clock-Speed
Clock-Speed

💻
Darek
Darek

🌍
Carl Higgs
Carl Higgs

💻
awmc000
awmc000

💻
Scott Smitelli
Scott Smitelli

🐛
lcgeneralprojects
lcgeneralprojects

🐛 💻
Christopher Lane
Christopher Lane

📖 ⚠️
David
David

💻
Sezer Bozkır
Sezer Bozkır

🌍
Odhy Pradhana
Odhy Pradhana

🌍
Li
Li

🐛
Matthias Schoettle
Matthias Schoettle

📖
Steve Simmons
Steve Simmons

🐛
João Henrique
João Henrique

📖
Bernhard Miklautz
Bernhard Miklautz

📖

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.8.1.tar.gz (256.6 kB view details)

Uploaded Source

Built Distribution

fpdf2-2.8.1-py2.py3-none-any.whl (227.8 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file fpdf2-2.8.1.tar.gz.

File metadata

  • Download URL: fpdf2-2.8.1.tar.gz
  • Upload date:
  • Size: 256.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for fpdf2-2.8.1.tar.gz
Algorithm Hash digest
SHA256 8866161396f942c8f7e3f022c4afb5e671b4d044745d4ed13c5d2ccc16ae5091
MD5 9019b13ec45ad0827ca76669651b62d8
BLAKE2b-256 e42fbfd880dbad75fb1921fd9e6523b7c163ca6297f15585fb002a6f276aadd5

See more details on using hashes here.

File details

Details for the file fpdf2-2.8.1-py2.py3-none-any.whl.

File metadata

  • Download URL: fpdf2-2.8.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 227.8 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for fpdf2-2.8.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 02f9e81ea5a0ec723c467de392bc6f4c54ea7859857e6fcee46579bd02bd335f
MD5 9b652be2b63fda170006e2766657bca0
BLAKE2b-256 145d4444880d9a49c21f57381505175b4302ae2d69fab7273c060ed9f9372d12

See more details on using hashes here.

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