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. The original FPDF library was developed in PHP several years ago, and has been ported to many programming languages: http://www.fpdf.org. Later, in the Python FPDF library, code for native reading TTF fonts was added. In 2008 it was moved from a SVN repository to git on Google Code by Mariano Reingart, who became the maintainer of FPDF. In 2013, it was migrated to GitHub: https://github.com/reingart/pyfpdf. You can still access the old issues, and old wiki, that were moved to a dedicated repository. The original roadmap can also still be found there: https://github.com/reingart/pyfpdf/wiki/Roadmap

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 original code (fpdf==1.7.2).

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

Additionally, HTML rendering is not guaranteed to be identical regarding whitespace, especially since version 2.7.6 and the new set of classes introduced to manage text flow: Text Flow Regions

Some features are also deprecated. As of version 2.8.4 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).