Note: a temporary 2.8.0 version was released but then erroneously removed on Pypi.
Versions 2.8.0 & 2.8.1 are exactly the same.
Added
- support for escape character for markers in markdown text issue #1215
- Wrapping words on spaces now considers all common space symbols in addition to regular spaces (' '), addressing issues with word-wrapping for languages like Thai, as per #1190 and #1191.
Templates
can now be also defined in JSON files.- support to optionally set
wrapmode
in templates (default"WORD"
can optionally be set to"CHAR"
to support wrapping on characters for scripts like Chinese or Japanese) - cf. #1159 - thanks to @carlhiggs - support for quadratic and cubic Bézier curves with
FPDF.bezier()
- thanks to @awmc000 - documentation on how to use
fpdf2
with Rough.js: link to docs - documentation on how to use
fpdf2
with gunicorn: link to docs - feature to identify the Unicode script of the input text and break it into fragments when different scripts are used, improving text shaping results
FPDF.image()
: now handleskeep_aspect_ratio
in combination with an enum value provided tox
FPDF.write_html()
: now supports CSS page breaks properties : documentationFPDF.write_html()
: new optionalfont_family
parameter to set the default font familyFPDF.write_html()
: spacing before lists can now be adjusted via thetag_styles
attribute - thanks to @lcgeneralprojects- file names are mentioned in errors when
fpdf2
fails to parse a SVG image
Fixed
FPDF.local_context()
used to leak styling during page breaks, when renderingfooter()
&header()
fpdf.drawing.DeviceCMYK
objects can now be passed toFPDF.set_draw_color()
,FPDF.set_fill_color()
andFPDF.set_text_color()
without raising aValueError
: documentation.FPDF.write_html()
: fixing rendering of<hr>
tags, that do not trigger a page break anymoreFPDF.write_html()
: fixed automatic page break when an image does not have enough vertical space to be rendered on a page- individual
/Resources
directories are now properly created for each document page. This change ensures better compliance with the PDF specification but results in a slight increase in the size of PDF documents. You can still use the old behavior by settingFPDF().single_resources_object = True
- line size calculation for fragments when text shaping is used
FPDF.write_html()
: fixed incoherent indentation of long<ul>
list entries - cf. issue #1073 - thanks to @lcgeneralprojects- default values for
top_margin
andbottom_margin
inHTML2FPDF._new_paragraph()
calls are now correctly converted into chosen document units. - In text_columns(), paragraph top/bottom margins didn't correctly trigger column breaks; issue #1214
fpdf.drawing.color_from_hex_string
did not test or mention accepting lowercase hex values.- handling of bidirectional text on
FPDF.get_string_width()
[issue #1231] - new translation of the tutorial in Indonesian - thanks to @odhyp
RecursionError
in some cases when callingFPDF.write_html()
insideFPDF.footer()
- issue #1222
Removed
- an obscure and undocumented feature of
FPDF.write_html()
, which used to magically pass instance attributes as arguments.
Deprecated
fpdf.TitleStyle
has been renamed intofpdf.TextStyle
FPDF.write_html()
:tag_indents
introduced in the last version - Now the indentation can be provided through thetag_styles
parameter, using the.l_margin
ofTextStyle
instances
Changed
FPDF.circle()
: the previousr
parameter, that in fact defined the diamter, has been replaced by a newradius
paremeter. Thex
&y
parameters now define the circle center, instead of its top-left corner as it used to be - issue #1245FPDF.table()
now raises an error when a single row is too high to be rendered on a single pageFPDF.write_html()
: indentation of HTML elements can now be non-integer (float), and is now independent of font size and bullet strings.- improved performance of font glyph selection by using functools cache
- Clarified usage of the
style
attribute inFPDF.add_font()