Skip to content

History

This project, fpdf2 is a fork of the PyFPDF project, which can still be found on GitHub at reingart/pyfpdf, but has been totally inactive since January 2018, and has not seen any new release since 2015.

About the original PyFPDF lib:

This project started as a Python fork of the FPDF PHP library, ported to Python by Max Pat in 2006: http://www.fpdf.org/dl.php?id=94. Later, code for native reading TTF fonts was added. The project aim is to keep the library up to date, to fulfill the goals of its original roadmap and provide a general overhaul of the codebase to address technical debt keeping features from being added and bugs to be eradicated. Until 2015 the code was developed at Google Code: you can still access the old issues, and old wiki.

How fpdf2 came to be

During the spring of 2016, David Ankin (@alexanderankin) started a fork of PyFPDF, and added the first commit of what became fpdf2: bd608e4. On May of 2017, the first release of fpdf2 was published on Pypi: v2.0.0.

On 2020, the first PRs were merged from external contributors. At the end of the year, Lucas Cimon (@Lucas-C) started contributing several improvements, in order to use fpdf2 for his Undying Dusk project. Version 2.1.0 was released and on 2021/01/10 fpdf2 was moved to a dedicated PyFPDF GitHub organization, and @Lucas-C became another maintainer of the project.

On 2023/08/04, fpdf2 moved to the py-pdf organization: https://github.com/py-pdf/fpdf2. The context for this move can be found there: discussion #752. On this date, the PyFPDF GitHub organization has been archived. The same month, Georg Mischler (@gmischler) and Anderson Herzogenrath da Costa (@andersonhc) joined the project as new maintainers.

Compatibility between PyFPDF & fpdf2

fpdf2 aims to be fully compatible with PyFPDF code.

The notable exceptions are:

  • for the cell() method, the default value of h has changed. It used to be 0 and is now set to the current value of FPDF.font_size
  • the font caching mechanism, that used the pickle module, has been removed, for security reasons, and because it provided little performance gain, and only for specific use cases - cf. issue #345.
  • Template elements now have a transparent background by default, instead of white

Some features are also deprecated. As of version 2.7.5 they still work but generate a warning when used:

Note that DeprecationWarning messages are not displayed by Python by default. To get warned about deprecated features used in your code, you must execute your scripts with the -Wd option (cf. documentation), or enable them programmatically with warnings.simplefilter('default', DeprecationWarning).