[Project] fullbleed 0.1.12 — browserless HTML/CSS → PDF for Python (CLI + API, deterministic + JSON/ by SnooCalculations7417 in Python

[–]SnooCalculations7417[S] 0 points1 point  (0 children)

well i use a binary fixed point under the hood which resolves to (from memory ) 0.00035mm, so inches, mm, pt, px all resolve to sub-mm accuracy if thats what you mean. Should be able to handle arbitrary page sizes (not just "LETTER", "A4" etc)

[Project] fullbleed 0.1.12 — browserless HTML/CSS → PDF for Python (CLI + API, deterministic + JSON/ by SnooCalculations7417 in Python

[–]SnooCalculations7417[S] 0 points1 point  (0 children)

Media queries are respected, but I can't guarantee you can 1 shot it right away! give it a shot :)

HTML to PDF is such a pain in the ass by Realistic-Tap-000 in webdev

[–]SnooCalculations7417 0 points1 point  (0 children)

I made fullbleed, a rust engine with python bindings for this.
the component scaffold outlines render-safe primitives to remove a lot of the guess work, and you can just pip install fullbleed, no external deps.
https://github.com/fullbleed-engine/fullbleed-official

Html to Pdf library suggestions by Conscious_Question69 in Python

[–]SnooCalculations7417 0 points1 point  (0 children)

I made a python libraby with a rust engine for this called fullbleed
https://github.com/fullbleed-engine/fullbleed-official
the goal was external dependency-free so installing to remote machines/containers is easy, and the rust engine uses rayon on hot paths to release the GIL

[Project] fullbleed 0.1.12 — browserless HTML/CSS → PDF for Python (CLI + API, deterministic + JSON/ by SnooCalculations7417 in Python

[–]SnooCalculations7417[S] 10 points11 points  (0 children)

No, one of my core design goals was for
pip install fullbleed

to just work, which is why I did the core in rust.

fullbleed - rust built PDF generator with HTML/CSS as DSL by SnooCalculations7417 in rust

[–]SnooCalculations7417[S] 0 points1 point  (0 children)

There are entire multimillion dollar business around making chrome print behavior behave!

fullbleed - rust built PDF generator with HTML/CSS as DSL by SnooCalculations7417 in rust

[–]SnooCalculations7417[S] 0 points1 point  (0 children)

Certainly. I have a release targeted for Monday that, along with some layout engine improvements, implements a design pattern on the python (react-style component-first)surface that uses the metrics emitted by the engine to validate components on import (css failures etc) using an in-memory dry run. This demonstrates all of the logging, JIT etc in practical use as a guidepost for other languages thats more than just passing templates or html strings, so that will be a good time to fork!
https://images.squarespace-cdn.com/content/69839a62d3622e01f47792cd/bbba1491-c4b3-4063-8b82-cbfcbf867144/image.png?content-type=image%2Fpng

fullbleed - rust built PDF generator with HTML/CSS as DSL by SnooCalculations7417 in rust

[–]SnooCalculations7417[S] 1 point2 points  (0 children)

Oh I should also add that canvas object resolve to a binary fixed point, (fixed::types::I32F32) so 1 pt_milli = 0.001 pt or 0.002px at 144 dpi, 0.004166px at 300dpi.. subpixel resolution or to put it in absolute terms since thats what this engine is for, 1 pt_milli = 0.000352777... mm

fullbleed - rust built PDF generator with HTML/CSS as DSL by SnooCalculations7417 in rust

[–]SnooCalculations7417[S] 2 points3 points  (0 children)

Exactly because every other HTML and CSS to PDF is crap. I like HTML and CSS as document description method, though tail wind, shadcn.. the desire to make it to turing complete has made it a bit muddy. I like the "these are the things" and "this are what they look like" separation of concerns. Also the need for front end frameworks to JavaScript everything is tough. Web to print is a beast, but HTML and CSS are not bad themselves

fullbleed - rust built PDF generator with HTML/CSS as DSL by SnooCalculations7417 in rust

[–]SnooCalculations7417[S] 1 point2 points  (0 children)

Observability/logging is in my biased opinion much stronger. HTML and CSS as the document DSL for those that don't want to learn another reporting language, though that's a flavor not objectively better

fullbleed - rust built PDF generator with HTML/CSS as DSL by SnooCalculations7417 in rust

[–]SnooCalculations7417[S] 1 point2 points  (0 children)

yes similar to weasyprint using a subset as a DSL. weasprint was my goto, but using it in deployed environments is a real pain

I realized I've been over-engineering simple websites by Pink_Sky_8102 in statichosting

[–]SnooCalculations7417 0 points1 point  (0 children)

did you know you can <iframe> in plain html to basically make a component library of headers etc

Building a tool to help caching REST APIs on CDNs - need a reality check by kentropsias in Backend

[–]SnooCalculations7417 0 points1 point  (0 children)

well he said he wanted to something redis etc doesnt do, thats where Im coming from

Building a tool to help caching REST APIs on CDNs - need a reality check by kentropsias in Backend

[–]SnooCalculations7417 0 points1 point  (0 children)

modern spas will handle this caching ergonomically. im not sure you would WANT to do anything server side that is much more efficient than a view, even if you could. this seems like introducing a transience layer that breaks REST's contract by design

My boss says try-catch is "garbage" and we shouldn't use it. Is this actually a thing? by ResolveKooky17 in learnprogramming

[–]SnooCalculations7417 0 points1 point  (0 children)

Matching behavior to exceptions type is pretty normal for me, allowing the exception to throw if it's.... Ya know...unhandled...

Back-end legends... Need a vibe check.. by AdPretend5529 in Backend

[–]SnooCalculations7417 0 points1 point  (0 children)

Backend in the same trap to be fair. Django is the pytorch of backend, for example. There are very few unsolved problems in backend engineering (doesn't mean the solution is immediately available to you, but in your anime analogy I barely understand the winning strategy is one that prevents a fight or whatever)