Browser support for printing CSS is spotty. Worse: some features, like footnotes on every page, don't have any equivalent in CSS I know of. Is there any easy to use/hack HTML layouting engine where I could experiment with custom CSS attributes and bridge that gap? Would anything from Servo be suitable? Modifying an entire browser with its bloat is too much effort. There is no JS or cookies on paper (they can be in pa…
https://pagedjs.org has a polyfill that implements https://www.w3.org/TR/css-gcpm-3/#footnotes
CSS for printing to paper
121–130 of 139 posts
Re: CSS for printing to paper
#122Earlier quoted context omitted.
> Brother's website for finding the mac drivers is a bit of a maze of misdirection that tries to get you to install their extremely shitty application. That seems surprising, considering how no-muss no-fuss their hardware & cartridges are. (As compared to, say, H-P.)
I think it's just regular incompetence for hardware companies not really being on top of their software game.
Re: CSS for printing to paper
#123Earlier quoted context omitted.
And it's not just a Paged.js thing. No "hacks" necessary. https://www.w3.org/TR/css-page-3/#page-based-counters
paged.js is a polyfill that implements this. I'm not aware of any browser that support this. Why do you call paged.js a "hack"?
I'm a big fan of paged.js.
Re: CSS for printing to paper
#124Earlier quoted context omitted.
And it's not just a Paged.js thing. No "hacks" necessary. https://www.w3.org/TR/css-page-3/#page-based-counters
What browser does it work in natively? I tried this a couple of years ago and a few people claimed that it worked in kiosk mode for Chrome but I couldn't get it to work in any browser.
https://developer.mozilla.org/en-US/docs/Web/CSS/@page#brows...
That said, I've always used paged.js with its polyfills to fill in other gaps. So maybe there's something I'm unaware of.
Re: CSS for printing to paper
#125Earlier quoted context omitted.
Weasy is tight . Unfortunately, my org banned Python across the board, else that would have been my choice.
I feel like there's a story here.
Now, ok, funny thing. Engineering could just get bare metal laptops, whenever they wanted, then blow the thrice-blessed CentOS image on it, and then do whatever the hell. So what happened - and this probably sounds real predictable - they used the CentOS machines to make all sorts of nutty crap, boxed it up, and then sent it back to their "official" Windows machines, now as a locked-in-amber config that never updates, even if five years later it had like fifty zero days in it and none of the libraries were good anymore.
I understand it took a new director and a LOT of meetings to explain whitelist mirrors for package managers, but I was long gone by then, even if I had a tiny hand in rolling out the demo whitelist mirror on-prem. Man, I had no idea what I was doing . . it still makes me shudder when I think of the things they were asking me to do.
Re: CSS for printing to paper
#126The code seems very opinionated, at least it is pretty focused on US needs. I don’t want someone to tell me what paper I should use (size: Letter portrait). Frankly I don’t own letter-sized paper. Also all sizes are in inches, which I don’t calculate in and wouldn’t know whether still sensible margins when printing on a different paper size.
If you want to use these techniques on a global site, I think you could use multiple @page styles and switch between them with a dropdown like I did with portrait/landscape. Although A4 and letter are very close in size.
Re: CSS for printing to paper
#127I recently setup a label printer where the labels get printed from a full page app to a Brother label printer that takes rolls of 62mm wide and 30 meters long. The printer cuts after each page break. It's a regular usb printer but with a funny page size. Also, Brother's website for finding the mac drivers is a bit of a maze of misdirection that tries to get you to install their extremely shitty application. In the en…
File -> Print (ctrl+p), the preview takes up the majority of the dialog.
Re: CSS for printing to paper
#128Re: CSS for printing to paper
#129A few of my favorite print styles, from my personal site: h2,h3,h4,h5,h6,h7,h8 {break-after: avoid-page;} img, svg, table, canvas {break-inside: avoid;} a::after {content: " (" attr(href) ")";} Explanation: - Avoid printing section headers at the bottom of one page with the section content left headerless at the top of the next page. - Prefer printing graphics and figures on whole pages instead of split across pages.…
Re: CSS for printing to paper
#130Browser support for printing CSS is spotty. Worse: some features, like footnotes on every page, don't have any equivalent in CSS I know of. Is there any easy to use/hack HTML layouting engine where I could experiment with custom CSS attributes and bridge that gap? Would anything from Servo be suitable? Modifying an entire browser with its bloat is too much effort. There is no JS or cookies on paper (they can be in pa…
> Is there any easy to use/hack HTML layouting engine where I could experiment with custom CSS attributes and bridge that gap? Would anything from Servo be suitable? Servo could be used for this. You'd want to add support for parsing the CSS properties themselves to the style crate in https://github.com/servo/stylo and then the layout implementation to the layout2020 crate in https://github.com/servo/servo . You do e…