Skip to content

HTMLMixin not needed anymore - more HTML tags supported - demonstration Jupyter notebook

Compare
Choose a tag to compare
@Lucas-C Lucas-C released this 20 Nov 17:51
· 377 commits to master since this release

Added

Deprecated

  • HTMLMixin is deprecated, and not needed anymore: the write_html() method is now natively available in the FPDF class - thanks to @yk-jp

Removed

  • open() & close() methods, that were only used internally and should never have been called by end-user code
  • FPDF.state, which was an instance of the DocumentState enum, and has been replaced by moving the final rendering logic into a new fpdf.output module

Fixed

  • after an "empty" cell(), ln() applied a line height of zero #601
  • when using multi_cell() with max_line_height to render multiline text, the last line is now rendered like all the others
  • templates don't leak graphics state changes to their surroundings anymore; #570
  • automatic page break is never performed on an empty page (when the Y position is at the top margin)
  • fixed insert_toc_placeholder() usage with footer() and {{nb}}; #548
  • the SVG parser now accepts stroke-width attribute values with an explicit unit, thanks to @gmischler; #526
  • the SVG parser now accepts absolute units for width and height attributes, thanks to @darioackermann; #555
  • write_html() method now correctly handles whitespace when parsing HTML. <pre></pre> blocks still maintain spaces, tabs and line breaks.

Changed

  • the first parameter of FPDF.add_font() is now optional: if it is not provided, the base name of the fname font path is used to define the font family. Hence pdf.add_font(fname="fonts/NotoSansArabic.ttf") will define a font named NotoSansArabic.
  • the output of embed_file() is now a PDFEmbeddedFile, not a string, but the internal file name can be retrieved through its .basename property
  • forbid use of get_y() & local_context() inside unbreakable() as it is currently not supported; #557
  • fontTools minimal version requirement set to 4.34.0; #524