This is a type stub package for the fpdf2 package, providing external type annotations for static analysis and type checking. It is part of the `typeshed` project and receives regular, often daily, automated releases to track changes in the upstream `fpdf2` library. This version of `types-fpdf2` aims to provide accurate annotations for `fpdf2==2.8.4`. Note that since `fpdf2` version 2.8.6, the `fpdf2` package itself includes type annotations, rendering `types-fpdf2` unnecessary for newer `fpdf2` versions.
pip install types-fpdf2Verified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates a minimal `fpdf2` usage. When `types-fpdf2` is installed in the same environment, type checkers like MyPy or Pyright will use its stubs to provide static analysis for your `fpdf2` code, ensuring type correctness and improving developer experience.
Uninstall `types-fpdf2` if using `fpdf2` version 2.8.6 or newer (`pip uninstall types-fpdf2`).
Explicitly add and set a TrueType font that supports the required Unicode range (e.g., `pdf.add_font(fname='path/to/my_unicode_font.ttf', uni=True)`).
For complex RTL layouts, manual text arrangement or external pre-processing might be necessary. Consider checking `fpdf2`'s documentation or community forums for workarounds.