Improvements to FPDF.table() - Text regions layout management - several bugfixes
This release is the first performed from the @py-pdf GitHub org, where fpdf2
migrated.
This release also marks the arrival of two new maintainers: Georg Mischler (@gmischler) and Anderson Herzogenrath da Costa (@andersonhc).
Added
- The new experimental method
text_columns()
allows to render text within a single or multiple columns, including height balancing: documentation FPDF.write_html()
now supports heading colors defined as attributes (e.g.<h2 color="#00ff00">...
)FPDF.table()
: Now supports padding in cells : documentationFPDF.table()
: Now supports vertical alignment in cells : documentationFPDF.table()
: Now supports outer border width for rendering the outer border of the table with a different line-widthFPDF.table()
: Now supports multiple heading rows : documentation- documentation on how to use
livereload
to enable a "watch" mode with PDF generation: Combine with livereload
Changed
- The formatting output by
write_html()
has changed in some aspects. Vertical spacing around headings and paragraphs may be slightly different, and elements at the top of the page don't have any extra spacing above anymore. FPDF.table()
: If the height of a row is governed by an image, then the default vertical alignment of the other cells is "center". This was "top".- variable-width non-breaking space (NBSP) support issue #834
This change was made for consistency between row-height governed by text or images. The old behaviour can be enforced using the new vertical alignment parameter.
Fixed
- In multi_cells and table cells with horizontal padding, the text was not given quite enough space.
write_html()
can now handle formatting tags within paragraphs without adding extra line breaks (except in table cells for now).- the font size in HTML
<pre>
and<code>
tags is not fixed to 11 pica anymore, but adapts to the preceding text. FPDF.ln()
, when called before any text has been written, will now use the current font height instead of doing nothing - cf. issue #937FPDF.image()
, when provided aBytesIO
instance, does not close it anymore - cf. issue #881- Invalid characters were being generated when a string contains parentheses - cf. issue #884
- Frozen Glyph dataclass was causing problems for FPDFRecorder with TTF fonts - cf. issue #890
- Edge case when parsing a Markdown link followed by a newline - cf. issue #916, and when bold/italics/underline markers are repeated
- Zoom not set correctly when a numeric value was set in
set_display_mode()
- cf. issue #926 FPDF.table()
: images no longer overlap with cell borders - cf. issue #892- Encryption of strings containing non-latin characters - cf. issue #933
- Handling of fragments with zero-length - cf. issue #902
Deprecated
- to improve naming consistency, the
txt
parameters ofFPDF.cell()
,FPDF.multi_cell()
,FPDF.text()
&FPDF.write()
have been renamed totext