Download Latest Version Add resource access controls, SVG complexity limits, Optional Content Groups, and other features and bug fixes source code.zip (80.6 MB)
Email in envelope

Get an email when there's a new version of fpdf2

Home / 2.8.8
Name Modified Size InfoDownloads / Week
Parent folder
Add resource access controls, SVG complexity limits, Optional Content Groups, and other features and bug fixes source code.tar.gz 2026-08-09 79.5 MB
Add resource access controls, SVG complexity limits, Optional Content Groups, and other features and bug fixes source code.zip 2026-08-09 80.6 MB
README.md 2026-08-09 5.3 kB
Totals: 3 Items   160.0 MB 4

[2.8.8] - 2026-08-09

[!WARNING] Upgrading to fpdf2 2.8.8 is strongly recommended for applications that render user-provided images, SVGs, or HTML content.

Added

  • Punjabi (pa) tutorial translation - thanks to @Pawansingh3889
  • FPDF.svg_limits and SVGLimits to configure SVG complexity limits while rendering SVG images
  • resource_access_policy and Security considerations documentation
  • FPDF.optional_content() context manager to mark content as visible on screen only or in print only, using PDF Optional Content Groups - cf. issue [#441], based on a recipe by @digidigital - thanks to @eugen-goebel
  • basic support for SVG <symbol> elements in the SVG parser - thanks to @Theo1335
  • basic support for SVG <switch> elements in the SVG parser - cf. issue [#537] - thanks to @dannymaaz
  • support for keeping aspect ratio for images in templates - cf. issue [#1118] - thanks to @prateek-dagar

Fixed

  • custom height passed to Paragraph.ln() in a text region is now applied to the line it terminates instead of the first line of the following paragraph - cf. issue [#1786] - thanks to @Sanjays2402
  • the optional numpy import in image_parsing.py no longer crashes on CPUs unsupported by numpy's manylinux wheel baseline; RuntimeError is now treated the same as ImportError, so numpy degrades to unavailable instead of taking down import fpdf - cf. issue [#1908] - thanks to @stumpylog
  • font state (family, style, size, current font, and the page-level "font is set" flag) no longer leaks back onto the FPDF instance after a text_columns() / text_region() context exits, so a subsequent pdf.cell() / pdf.write() renders at the caller's font instead of the last paragraph's - cf. issue [#1804] - thanks to @Pawansingh3889
  • text rendering when the first text on a page starts with a fallback glyph - cf. issue [#1772]
  • preserve boundary-neutral formatting during bidirectional text preprocessing - cf. issue [#1779]
  • transform application on user space gradients - cf. issue [#1784]
  • dependency extras for camelot-py and endesive on pyproject.toml - cf. issue [#1792]
  • preserve link annotations during dry-run of FPDF.multi_cell - cf. issue [#1807] - thanks to @CoLa5
  • preserve two consecutive markdown links (without space inbetween) - cf. issue [#1814] - thanks to @CoLa5
  • support markdown style around markdown links - cf. issue [#1826] - thanks to @CoLa5
  • Reset gstate for ToC-rendering - cf. issue [#1837] - thanks to @CoLa5
  • preserve markdown format in FPDF.multi_cell in dry-run - cf. issue [#1840] - thanks to @CoLa5
  • fix page order after dry-run of FPDF.multi_cell in ToC - cf. issue [#1836] - thanks to @CoLa5
  • rendering SVG arcs with very small sweeps that previously rounded to zero - cf. issue [#1831]
  • spurious "Not enough horizontal space to render a single character" error when text without break opportunities is split into many small fragments, e.g. by a fallback font alternating with the main font - cf. issue [#1250] - thanks to @uttam12331
  • number of surviving escape characters - cf. issue [#1215] - thanks to @amidou-naba
  • leading spaces on new lines inside <pre> and <pre><code> blocks are no longer dropped - cf. issue [#1063] - thanks to @eugen-goebel
  • FPDF.set_font() can restore current_font when the selected font state diverged - cf. PR [#1872] - thanks to @gaoflow
  • embed CID-keyed CFF fonts as raw CFF programs so browser PDF viewers render them correctly - cf. issue [#1874]
  • fixed broken links on documentation not directly leading to the API reference - cf. issue [#1876] - thanks to @iamfazakb
  • reject SVG <use> cycles and excessive nested expansion to prevent resource exhaustion in FPDF.image()
  • count SVG <switch> elements in SVG complexity limits
  • declare the default base state and display order for Optional Content Groups so PDF viewers can list layers correctly - cf. issue [#1895]

Changed

  • skip byte-for-byte compressed data comparison when zlib-ng is detected, regardless of OS
Source: README.md, updated 2026-08-09