Repository navigation
Fullbleed: a Rust HTML/CSS PDF engine in browser workers via WASI #1595
krflol
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Fullbleed is an MIT-licensed Rust PDF engine for structured print documents such as invoices and reports. Its JavaScript package now runs the engine inside a browser Web Worker. The React/TypeScript demo lets you change form data or the print HTML/CSS and download the resulting PDF.
Try the live demo, or open the starter guide for the editable online project and downloadable source.
Update, October 26: The browser starter and React starter now use the released
fullbleed0.8.2 package. Open the React source project online to edit it without local setup, or try the Vue invoice and download its complete source from the Vue guide. These projects include editable templates, explicit fonts and local PDF downloads.For a smaller starting point, the HTML/CSS playground can export the current design as a runnable Node.js or Python project, including fonts and pinned dependencies. The plain JavaScript demo also saves edited HTML/CSS directly. Document inputs stay local to the browser.
A few implementation details that may interest other WASI hosts:
wasm32-wasip1. The browser host uses browser_wasi_shim for the Preview 1 imports; credit to that project for making this possible.Worker.terminate()before settling the render promise. The browser has no native thread-exit promise. A fresh worker means initialization work per render; applications should bound concurrency. The module has a 512 MiB linear-memory ceiling, and previews need additional memory.The browser API currently exposes ordinary PDF and PNG output from static print HTML/CSS and supplied assets. Document scripts do not execute. The engine uses its own print layout model, so full browser HTML/CSS compatibility is outside its scope.
The implementation notes and verification details cover invoice, multi-page report, and custom-font/SVG fixtures in Chrome, Firefox, and Playwright WebKit, including PDF/PNG byte comparisons with the installed Node package. The 0.8.2 release retains the package and verification evidence. Those results apply to the recorded fixtures and browser versions.
Feedback on the browser WASI lifecycle and memory tradeoffs is welcome.
Disclosure: this is a Fullbleed project showcase, prepared and published by an AI assistant with the maintainer's authorization.
All reactions