unstale

pypi / fpdf2

fpdf2

What changed in fpdf2 2, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-20.

3 breaking7 new APIs and options1 behavior and defaults30 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli on npm

fpdf2 241 changes

Breaking changes 3

  • Booleans in arrays and dictionaries serialize as lowercase true and false, None in arrays as null, and filtering empty dictionary fields preserves False and numeric zero.

    2.8.9release notes

  • A custom height passed in a text region is now applied to the line it terminates, rather than the first line of the following paragraph.

    2.8.8release notes

  • Rejects SVG <use> cycles and excessive nested expansion to prevent resource exhaustion in FPDF.image().

    2.8.8release notes

New APIs and options 7

  • Adds an align parameter to control horizontal alignment of page-number substitution text inside reserved alias space.

    2.8.9release notes

  • Adds an appearance parameter accepting FileAttachmentAppearance.HIDDEN to hide the annotation's default icon while keeping the embedded file reachable.

    2.8.9release notes

  • Adds support for page number alias substitution with bidirectional and RTL text shaping.

    2.8.9release notes

  • Adds configurable SVG complexity limits when rendering SVG images.

    2.8.8release notes

  • Adds support for keeping aspect ratio for images in templates.

    2.8.8release notes

  • Adds basic support for SVG <switch> elements in the SVG parser.

    2.8.8release notes

  • Adds basic support for SVG <symbol> elements in the SVG parser.

    2.8.8release notes

Behavior and default changes 1

  • Fonts with both outline and bitmap glyphs now prefer outline glyphs.

    2.8.7release notes

Fixes and other changes 30

  • PDF/A-1 documents using TrueType or CFF-based CID fonts now include a /CIDSet stream in each font descriptor, as required by ISO 19005-1.

    2.8.9release notes

  • Escaped Markdown markers adjacent to emphasis markers in link labels no longer lose literal characters or apply unintended styling.

    2.8.9release notes

  • List bullets now use correct font styling instead of inheriting styles from a preceding heading.

    2.8.9release notes

  • List line-height values that are not bare numbers are ignored, using the default line height instead of raising IndexError.

    2.8.9release notes

  • Now accepts 1-element sequences per CSS shorthand rules and preserves existing Padding instances without redundant allocations.

    2.8.9release notes

  • Fixes table cells landing in the wrong column when a row is covered by several rowspans that do not start in column order.

    2.8.9release notes

  • Percentage width and height values with surrounding whitespace no longer raise ValueError.

    2.8.9release notes

  • Fixes a visual gap in subsequent text rendering after a page alias when text shaping is enabled.

    2.8.9release notes

  • CMap mappings are split into blocks of at most 100 entries to meet the PDF specification.

    2.8.9release notes

  • Preserves boundary-neutral formatting during bidirectional text preprocessing.

    2.8.8release notes

  • Embeds CID-keyed CFF fonts as raw CFF programs so browser PDF viewers render them correctly.

    2.8.8release notes

  • Fixes the number of surviving escape characters.

    2.8.8release notes

  • Fixes text rendering when the first text on a page starts with a fallback glyph.

    2.8.8release notes

  • Dry runs now preserve link annotations and markdown formatting; ToC dry runs also preserve page order.

    2.8.8release notes

  • Can restore current_font when the selected font state has diverged.

    2.8.8release notes

  • Preserves consecutive markdown links without intervening spaces and supports markdown styling around links.

    2.8.8release notes

  • Treats RuntimeError like ImportError for the optional numpy import, so unsupported CPUs make numpy unavailable instead of causing import fpdf to fail.

    2.8.8release notes

  • Declares the default base state and display order so PDF viewers can list layers correctly.

    2.8.8release notes

  • Leading spaces on new lines inside preformatted blocks are no longer dropped.

    2.8.8release notes

  • Fixes rendering SVG arcs with very small sweeps that previously rounded to zero.

    2.8.8release notes

  • Counts SVG <switch> elements toward SVG complexity limits.

    2.8.8release notes

  • Font state no longer leaks onto the FPDF instance after text_columns() or text_region() exits, so subsequent cell() or write() calls use the caller's font.

    2.8.8release notes

  • Font state no longer leaks onto the FPDF instance after text_region() exits, so subsequent cell() or write() calls use the caller's font.

    2.8.8release notes

  • Avoids a spurious horizontal-space error when unbreakable text is split into many small fragments, such as by alternating fallback and main fonts.

    2.8.8release notes

  • Resets graphics state for ToC rendering and fixes page order after multi_cell dry runs in a ToC.

    2.8.8release notes

  • Fixes transform application on user space gradients.

    2.8.8release notes

  • Fixed the types for FPDF.add_font().

    2.8.7release notes

  • Fixed the types for FPDF.output().

    2.8.7release notes

  • Fixed the type for FPDF.title.

    2.8.7release notes

  • Reverted changes to ImageInfo that impacted the user-facing API.

    2.8.7release notes