Remix.run Logo
sandreas 7 hours ago

Thank you for the nice (and still short) article - I really liked it.

However, while these rules apply for web pages, I would like to... let's say warn all developers expecting CSS is a good option for accurate printing.

It may work for single page printouts or "make this page more printable" approaches, but don't expect it to be an easy opt out of providing PDFs for every single use case.

CSS for printing gets annoying pretty quick as soon as you have some more sophisticated requirements. You should probably also know that print-CSS is not fully cross browser compatible - there are quirks and caveats for every single one of them regarding font sizing, margin, padding and page-layouts.

I would not recommend to use HTML + CSS for something that really needs to be exactly the same layout in every browser.

barishnamazov 7 hours ago | parent | next [-]

Thanks for the feedback! Agreed, I too have experienced those quirks. This applies to most modern CSS features in general :-)

FWIW, I also have had also success with running a server-side headless chromium instance on an app where I was generating nicely formatted exam from provided questions.

TeMPOraL 4 hours ago | parent | prev | next [-]

OTOH, it's good enough that a webapp I vibe-coded in 5 minutes on the phone is better at typesetting and aligning label stickers than Microsoft Word. Or at least easier and gives correct results on the first try, vs. Word that gives me correct results approximately never; I've wasted close to person-day fighting with it over the year already.

marczellm 7 hours ago | parent | prev [-]

Yeah we wanted something that would print with exact physical sizes and there's no reliable support for that so we ended up generating PDF with PDFium in WebAssembly.