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, grype, guarddog, 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

💻
petri-lipponen-movesense
petri-lipponen-movesense

💻
Soomin Choi
Soomin Choi

💻
Black-Hole
Black-Hole

🌍
lka
lka

💻 📖 🤔
andreaswimmer
andreaswimmer

🐛
Mercuron
Mercuron

💻

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

Uploaded Source

Built Distribution

fpdf2-2.8.3-py2.py3-none-any.whl (245.7 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

  • Download URL: fpdf2-2.8.3.tar.gz
  • Upload date:
  • Size: 278.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for fpdf2-2.8.3.tar.gz
Algorithm Hash digest
SHA256 494dc0bd935271c9ce16fb3a47c98b6f59b8d160cd519c2d3a7ed243c3852456
MD5 f36e52432c78f99360436c9b31904fd2
BLAKE2b-256 eaa26464c0406365d50bcf000a72c6ede7b6633f08ad8bccdc1553265bb15ccf

See more details on using hashes here.

Provenance

The following attestation bundles were made for fpdf2-2.8.3.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.3-py2.py3-none-any.whl.

File metadata

  • Download URL: fpdf2-2.8.3-py2.py3-none-any.whl
  • Upload date:
  • Size: 245.7 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for fpdf2-2.8.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 0529d7bf1c46e7031768f442e7def37545b619b1bcd34e9c540de3d866f61550
MD5 6321ba5ee6c5dc04245879546a86670a
BLAKE2b-256 ef0da79fe9d1c5fa165a940c7a7907d30a5b5f88d14d82dca0afe73618f4b07a

See more details on using hashes here.

Provenance

The following attestation bundles were made for fpdf2-2.8.3-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 Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page