Skip to content

chore(deps): update Rust crate printpdf to v0.12.9 - #252

Merged
mergify[bot] merged 1 commit into
mainfrom
renovate/printpdf-0.x-lockfile
Nov 12, 2026
Merged

mergify[bot] merged 1 commit into
mainfrom
renovate/printpdf-0.x-lockfile

Conversation

@renovate

@renovate renovate Bot commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

This PR contains the following updates:

Package Type Update Change
printpdf dependencies patch 0.12.8 → 0.12.9

Release Notes

fschutt/printpdf (printpdf)

v0.12.9

Compare Source

azul 0.0.17 (azul#476). The azul-css / azul-core / azul-layout pins move to
0.0.17: the HTML components use azul-core's ComponentCodegen, FontHash
carries synthetic_bold, and paged layout fixes azul#478 (a table that
overflows a page now fills every non-final page; the regression tests from
#​291 run by default). Also in this release: pictures decoded per page and
written with 1 bit where possible (#​290), from_html errors (#​294), Arabic
shaping in the SVG preview (#​293), text color alpha (#​287), same-page bookmark
order (#​282) and the multiple-fonts example (#​283).

from_html no longer answers Ok with an empty document. When the HTML
loader could not read the page (for example a character XML 1.0 excludes,
such as U+FFFE or a C0 control, reaching azul's strict loader), the
conversion returned Ok(PdfDocument) with no pages and the reason only in
warnings, so callers rendered blank output without noticing (pdfocr #​11).
from_html, from_html_with_cache and from_html_debug_with_cache now
return Err with the loader's messages joined; warnings still gets the
details. Test: tests/html_errors.rs.

The SVG preview shows shaped text the way the PDF does (Arabic joins).
PdfPage::to_svg, which the web demo's page view uses, wrote every shaped
glyph back out as its Unicode text, one <text> per glyph, and the browser
shaped each character again on its own: Arabic came out as isolated,
unjoined letters (and ligatures and Indic conjuncts fell apart), and a
parsed PDF's visual-order line was bidi-reversed a second time. The PDF
itself was always shaped correctly. Glyph-id runs are now painted from the
glyph outlines (<defs> + <use>), pen-advanced by the same /W widths a
PDF viewer uses; the <text> stays as an unpainted layer for selection and
search. Text written as TextItem::Text and the builtin fonts render as
before. Tests: tests/arabic_shaping.rs.

A CID-keyed CFF font read from a PDF keeps its glyph widths. The
synthesized hmtx of a bare CFF program took a glyph's first stem
coordinate as its width when the first hint operator sat in a subroutine
and had no width operand (NotoSansJP's 語: advance 0, so the rest of a
parsed line was drawn on top of it). Test: tests/parsed_cff_widths.rs.

HTML: a page decodes only the pictures it shows. PdfDocument::from_html*
copied (and base64-decoded) every entry of the images map, and the bridge
decoded every one of them, on every call, whether the page's HTML used it or
not; every decoded picture was also embedded. Rendering a 1053-page book page
by page with its 57 pictures in the map took 22 minutes (1.26 s a page);
handing each page only the pictures its <img src> names took 3.5 (0.24 s a
page). After layout, the renderer now collects the <img src> values the pages
draw and looks up, decodes and embeds only those, once each
(bridge::referenced_image_srcs). The same holds for xml_to_pdf_pages,
add_xml_to_document and from_html_debug* (which also no longer decodes
every picture twice). bridge::resolve_html_images still decodes a whole map.

  • An entry no page shows can no longer fail the call: a bad base64 string
    there used to make from_html* return Err("Base64 decode error: …").
  • A picture a page shows that has no entry, or whose entry cannot be
    base64-decoded or decoded, is now a warning in from_html*'s warnings
    naming its src (the <img> draws nothing, as before). A bad base64 string
    for a shown picture used to fail the whole call.

Tests: tests/html_images_on_demand.rs, and the decode count in
src/html/mod.rs (an_image_the_page_does_not_reference_is_not_decoded).

HTML text now honours color alpha. The HTML bridge emitted text fill
colors from the RGB channels only, so color: transparent painted opaque
black glyphs and color: rgba(…, 0.5) painted fully opaque ones. Each text
run whose color is not opaque now gets its own q … Q scope:

  • alpha 0 (transparent) uses text rendering mode 3 (3 Tr, invisible). The
    glyphs stay selectable, searchable and extractable, which is how OCR text
    layers over a page scan work.
  • partial alpha loads an ExtGState with the fill/stroke alpha, the same way
    translucent rects already did.

Inline background-color behind glyph runs had the same bug (translucent
backgrounds were painted opaque) and now gets the same ExtGState. Opaque text
emits exactly the same ops as before. Tests: tests/html_text_alpha.rs.

Smaller text: one text object per line instead of one per word (#​288).
A page of HTML text in a base-14 family wrote two text objects per word
(Tf BT /Span <</ActualText …>> BDC Tm TJ EMC ET for the word, again for
the space). On a 1000-word book page the Flate-compressed content stream
goes from 45 KB to 17 KB with positioned words, and from 32 KB to 12 KB with
flowing paragraphs. Rendering and extracted text are unchanged.

  • The bundled base-14 subsets have a space. None of the 14 fonts in
    defaultfonts/ had a glyph for U+0020 or U+00A0, so every space fell back
    to a system font (HelveticaNeue on macOS): a font switch, and a new glyph
    run, at every word, plus a second, machine-dependent font in the PDF. Each
    subset now has an empty space glyph with the standard base-14 advance,
    appended so existing glyph ids are unchanged (scripts/add_space_glyphs.py).
    !, ” and a few others are still missing (see #​288).
  • optimize merges text objects (src/text_merge.rs): consecutive text
    objects with only text state between them become one, a font or fill colour
    that is already set is not set again, and /ActualText spans that follow
    each other on one baseline become one span with the joined text.
  • Glyph runs: whole-unit kerns, one string per unkerned sequence. The
    same-baseline merger wrote a kern after almost every glyph for the
    fraction-of-a-unit difference between the layout's positions and the integer
    /W widths ([<0030> -0.16767642<0041> …]). Kerns are now rounded to whole
    thousandths of an em, with the exact pen position carried along so the error
    stays below half a unit, and glyphs without a kern between them share one
    hex string.

Regression test for azul#478 — multi-page tables broke about a third early.
tests/html_table_page_breaks.rs renders the reporter's fixture (one <table> of
identical single-line rows, default A4, no break-* CSS), finds the single-page
capacity by bisection, and asserts that once the table overflows every non-final
page is still filled. Against azul-layout 0.0.16 a table of capacity + 1 rows
paginates as 32 + 18 (the reporter saw 29 + 17), so both tests are #[ignore]d
until the azul pins move past the fix; run them with --ignored to check a
patched azul-layout, and drop the attribute on the bump.

For the record, this is not the 0.12.6 policy switch: 0.12.6 already ran
break-aware pagination against azul 0.0.14 and paginated the same fixture as
45 + 1. Two azul-layout defects combine in 0.0.16. The trigger: the display
list widens an overflow-visible node's text clip to its "scroll content size",
which is floored at the node's BORDER box, from the content-box origin, so each
cell's text clip runs padding-top pixels into the next row and the rows'
avoid-ranges overlap. The amplifier, latent since the break-aware paginator was
written:
page_breaks::snap_break_up took every containing range as nesting, so after
snapping to a row's top the break was "inside" the previous row, snapped again,
and climbed row by row until the max_push_distance budget (0.33 × page) was
spent. The azul fix lets only a range that ENCLOSES the range the break just
left pull it further up (true nesting: a line inside a break-inside: avoid
box), never a sibling that merely overlaps its top edge; a second azul fix
stops the clip widening for a box whose only "overflow" is its own padding.
The snap fix alone makes this test pass; with both, the break lands exactly at
the top of the first row that no longer fits.


Configuration

📅 Schedule: (UTC)

  • Branch creation
    • At any time (no schedule defined)
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Enabled.

♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@mergify

mergify Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

This pull request is merged.

@mergify
mergify Bot merged commit 48f4404 into main Nov 12, 2026
4 checks passed
@renovate
renovate Bot deleted the renovate/printpdf-0.x-lockfile branch November 12, 2026 03:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants