Added
- demonstration Jupyter notebook: tutorial/notebook.ipynb
- new
.default_page_dimensions
property onFPDF
instances - support for description list (
<dl>
), description titles (<dt>
), description details (<dd>
) and code blocks (<code></code>
) inwrite_html()
- thanks to @yk-jp & @seanpmulholland - support for monochromatic images (PIL
image.mode == '1'
) thanks to @GerardoAllende - the 1000+ unit tests suite is now executed under Linux and Windows, with extra timing & memory usage checks ensuring we control
fpdf2
resource usage - new translation of the tutorial in עברית, thanks to @TzviGreenfeld
- new documentation for using PyPDF2 with
fpdf2
, added by @devdev29: https://pyfpdf.github.io/fpdf2/CombineWithPyPDF2.html
Deprecated
HTMLMixin
is deprecated, and not needed anymore: thewrite_html()
method is now natively available in theFPDF
class - thanks to @yk-jp
Removed
open()
&close()
methods, that were only used internally and should never have been called by end-user code
Fixed
- after an "empty"
cell()
,ln()
applied a line height of zero #601 - when using
multi_cell()
withmax_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 withfooter()
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
andheight
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 thefname
font path is used to define the font family. Hencepdf.add_font(fname="fonts/NotoSansArabic.ttf")
will define a font namedNotoSansArabic
. - the output of
embed_file()
is now aPDFEmbeddedFile
, not a string, but the internal file name can be retrieved through its.basename
property - forbid use of
get_y()
&local_context()
insideunbreakable()
as it is currently not supported; #557 - fontTools minimal version requirement set to 4.34.0; #524