Skip to content

v0.23.0

Choose a tag to compare

@danmolitor danmolitor released this 11 Sep 18:23
· 162 commits to main since this release
fb9adcd

A minor with a new Python rendering path, a CSS property that had been missing since the HTML path shipped, and two fixes on documented happy paths. All packages share the line: engine (crates.io forme-pdf), every @formepdf/* npm package, formepdf (PyPI), forme-go (tag v0.23.0), and the VS Code extension.

Added

  • Local HTML → PDF from Python, no system libraries. render_html(html, ...) renders in-process through the engine compiled to wasm32-wasip1 and run via wasmtime — no cairo, no pango, no browser. pip install formepdf[local] pulls one dependency. The output is byte-identical to @formepdf/html, because it is the same Rust engine rather than a re-implementation, and a CI job renders the same input through both paths and requires identical bytes on every commit.
  • A shared option parser for both WASM front-ends. The camelCase render options (pageSize, pageMargin, css, fonts, tagged, pdfUa, pdfUa2, lang, pdfA, auditContent) are now parsed by one crate module used by both the wasm-bindgen (JS) build and the wasm32-wasip1 C-ABI build the Python and Go SDKs load — the two agree by construction, which is what makes the byte-identity above hold.
  • box-sizing joins the CSS subset. CSS dimensions are content-box by default while the engine's fixed dimension is always the border box, so a padded, bordered height: 615pt frame rendered 69pt short — everywhere, since the HTML path shipped. Point-valued width/height/min-*/max-* now grow by padding + border under content-box; a declared border-box (the Bootstrap reset) passes through untouched. Percentage dimensions are unchanged on both settings.
  • A worked e-invoicing guide: rendering with Forme and converting through a PDP or e-invoicing service, with the EN 16931 mapping table and a runnable example. The round trip is verified end to end — the returned Factur-X passes veraPDF (PDF/A-3b) and Mustangproject (EN 16931 schematron).

Fixed

  • pdfa alone now embeds the fonts-standard substitutes. The Liberation substitution for base-14 families was gated on pdfUa (or PDF 2.0), while PDF/A's own embedded-fonts check counts a base-14 family as embedded only via that substitution — so pdfa without pdfUa failed with "'Helvetica' is not embedded" even with @formepdf/fonts-standard registered. If you render PDF/A without also claiming PDF/UA, this is the fix you want.
  • align-items: center respects max-width. The centering offset used the unclamped intrinsic width, so a max-width'd block inside a centered column sat flush left while its lines wrapped at the clamp.

Behavior changes

  • Content-box documents get bigger boxes, matching Chrome. Any document pairing fixed point dimensions with padding or border is affected: fixed-width table columns now include their padding (a squeezed flexible column may wrap differently), bordered checkboxes render at their true size, and framed layouts reach the margins they were designed to reach. Documents that declare box-sizing: border-box (the common reset) render byte-identically to before.

Per-package detail in each package's CHANGELOG.md.