| Name | Modified | Size | Downloads / Week |
|---|---|---|---|
| Parent folder | |||
| README.md | 2026-10-16 | 4.6 kB | |
| v0.2.25 source code.tar.gz | 2026-10-16 | 7.6 MB | |
| v0.2.25 source code.zip | 2026-10-16 | 7.8 MB | |
| Totals: 3 Items | 15.5 MB | 0 | |
⚠️ Important notes
- pyHanko is no longer installed with xhtml2pdf. Signing a PDF needs the
signingextra, whichallincludes:pip install xhtml2pdf[all]installs what a plain install did before. Without it, asking for a signature raises anImportErrorthat names the extra, rather than writing an unsigned PDF. Fixes :issue:809and :issue:755.
🎉 New
-pdf-frame-pages: lastpaints a Static Frame on the last page only, andnot-laston every page but the last: a signature block or a closing footer at the end of a document of any length. See :doc:format_html. Fixes :issue:105.-pdf-frame-align: bottomputs a block at the bottom of the page it lands on, and moves it whole to the bottom of the next page when it does not fit: a signature at the foot of the last page. See :doc:format_html. Fixes :issue:429.<pdf:resetpagenumber value="1"/>starts the page numbering again on the page it falls on, for the headers and footers,<pdf:pagenumber>in the flow and the table of contents. Fixes :issue:461.
🐛 Bug-Fixes
- Conversions in different threads of a process no longer swap fonts. Two documents converted at once could come out with the bold or italic of a family missing, or drawn with another document's file, with no error. A process now converts one document at a time; see the Python API reference for converting in parallel with processes.
- Two documents that name a
font-familythe same and embed different files each draw with their own, also one after the other. The second used to be drawn with the first one's file, with a warning. - Every image is drawn with its own pixels again. Since 0.2.23 a document
with several PNGs (or GIFs, or any image other than a JPEG) drew each of
them as the first one: a logo and two charts came out as three logos.
Fixes :issue:
848. - An inline element with padding or a border right after a
<br/>no longer fails the render withIndexError: string index out of rangewhen its text starts with whitespace, such as . Fixes :issue:849. - A non-breaking space at the start of a line after a
<br/>is kept, as a browser keeps it:<br/>  textis indented by two spaces, not one. - The top and bottom margins of a
<div>(or any block without padding, a border or a background) are kept when what it holds are paragraphs or other blocks with margins of their own. The block's margin goes above its first child and below its last, collapsing with theirs to the larger one as in a browser; a<div style="margin-bottom: 1in">around a<p style="margin: 0">used to leave no room at all. Text directly inside such a block no longer repeats the block's margins above and below every paragraph of it, and a block's vertical margins are no longer inherited by the blocks inside it. Fixes :issue:310. <pdf:pagecount>written in the flow, outside a static frame, shows the number of pages of the document. On the pages laid out before the last one it showed how many pages there were so far:Page 1 of 1on the first page of two.paddingon<body>or<html>is room around the page content, given once: the sides indent every block and the tables in the flow, the top is room above the first block. Every paragraph used to draw it again, so a body withpadding: 20pxspread its lines down the page. Fixes :issue:728.- A
<canvas type="graph">chart takes the margins and the padding of the block around it, its own margins when it isdisplay: block, and thetext-alignof its block:text-align: centercentres it. It was always put at the left edge, flush against what came before and after. Fixes :issue:693. widthon a<div>, a<p>or any other block is applied: a length, or a percentage of the block that contains it, as the width of its content box.margin: 0 autocentres the block andmargin-left: autoputs it on the right. A block always took the whole width of the frame. Fixes :issue:545.
| Thanks to the following people on GitHub for contributing to this release:
| cristianchiriac, who fixed the IndexError after a <br/>
(:pr:850), rondanen, whose report of the repeated PNG found its
cause, and wyhsu1128, who narrowed the <br/> crash down to a few
lines of HTML.
Full Changelog: https://github.com/xhtml2pdf/xhtml2pdf/compare/v0.2.24...v0.2.25