Skip to content

Support for Images and Clipping Paths in SVG files - Python 3.12 Support - Several Bugfixes

Compare
Choose a tag to compare
@gmischler gmischler released this 10 Dec 13:40
· 165 commits to master since this release
652a517

Added

  • Basic support for <image> elements in SVG vector graphics inserted
  • SVG importing now supports clipping paths, and <defs> tags anywhere in the SVG file - thanks to @afriedman412 - cf. #968
  • FPDF.fonts.FontFace: Now has a static combine method that allows overriding a default FontFace (e.g. for specific cells in a table). Unspecified properties of the override FontFace retain the values of the default - thanks to @TedBrookings - cf. #979
  • TextColumns() can now have images inserted (both raster and vector) - thanks to @gmischler
  • TextColumns() can now advance to the next column with the new new_column() method or a FORM_FEED character (\u000c) in the text - thanks to @gmischler
  • Added support for Free Text annotations: documentation - thanks to @MarekT0v - cf. #1039
  • Tutorial in Dutch: Handleiding - thanks to @Polderrider
  • Python 3.12 is now officially supported

Fixed

  • Links over text in tables were broken in release 2.7.6, this is now fixed
  • FPDF.set_font_color() raised a TypeError when used in tables
  • FPDF.image(x=Align.C) used to fail for SVG images - fixed thanks to @gmischler - cf. #1003
  • Previously set dash patterns were not transferred correctly to new pages - fixed thanks to @gmischler - cf. #993
  • Inserted Vector images used to ignore the keep_aspect_ratio argument.
  • FPDF.write_html() now properly honor the current text font color when styling table cells
  • FPDF.write_html() delays unescaping data so as not to confuse entity names as nested tags
  • FPDF.multi_cell() has improved handling of new_x and new_y when padding is non-zero.
  • FPDF.multi_cell(fill=True) now avoids overlapping multiline strings when padding is non-zero.

Changed

  • the public .images, .icc_profiles & .image_filter attributes of FPDF instances have been moved inside a nested FPDF.image_cache attribute. Similarly, the FPDF.preload_image() is now a function in the fpdf.image_parsing module: documentation
  • the fpdf.svg module now produces WARNING log messages for unsupported SVG tags & attributes.
    If those logs annoy you, you can suppress them: logging.getLogger("fpdf.svg").propagate = False
  • FPDF.table(): If cell styles are provided for cells in heading rows, combine the cell style as an override with the overall heading style.