Skip to main content

Simple & fast PDF generation for Python

Project description

Pypi latest version Python Support License: LGPL v3

build status codecov Pypi Trusted Publisher: enabled checks: 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

📖
Bryn Jeffries
Bryn Jeffries

🐛
Benoit Charbonneau
Benoit Charbonneau

🤔
Philip Jones
Philip Jones

🐛
opposss
opposss

💻
Dat Le
Dat Le

🐛 💻
Kaustubh
Kaustubh

💻
Derek Robinson
Derek Robinson

🐛
Kevin Castro
Kevin Castro

🐛
jasonfevangsafe
jasonfevangsafe

📖
visheshdvivedi
visheshdvivedi

💻

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

Uploaded Source

Built Distribution

fpdf2-2.8.2-py2.py3-none-any.whl (236.3 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

  • Download URL: fpdf2-2.8.2.tar.gz
  • Upload date:
  • Size: 266.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for fpdf2-2.8.2.tar.gz
Algorithm Hash digest
SHA256 3a2c6699c39b23b786fc6ad9fc3de5432e59f6b6383bb9ab4ce1f994a5f3e762
MD5 ff01a954528f583a6609dbc1f1c0283c
BLAKE2b-256 b0540e86f986e81abad9e6b348f5176048a2aa046920d46292c42a581064d93e

See more details on using hashes here.

Provenance

The following attestation bundles were made for fpdf2-2.8.2.tar.gz:

Publisher: continuous-integration-workflow.yml on py-pdf/fpdf2

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: fpdf2-2.8.2-py2.py3-none-any.whl
  • Upload date:
  • Size: 236.3 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for fpdf2-2.8.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 951e26290d0fc6ab4582b0d0bbacb64716fecef0f2b9223f9178c90ec4321af7
MD5 0b91dfbebd23a01f18b6dd1465776fa1
BLAKE2b-256 eb467aae9cb2584dcac217e662ab6d4670ef4e447b73d624b6210f7155322411

See more details on using hashes here.

Provenance

The following attestation bundles were made for fpdf2-2.8.2-py2.py3-none-any.whl:

Publisher: continuous-integration-workflow.yml on py-pdf/fpdf2

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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