Live data from Hacker News

CSS for printing to paper

voussoir.net

91–100 of 139 posts

Re: CSS for printing to paper

#91

Earlier quoted context omitted.

I’ve never understood what everyone’s issue with PDF is. It’s like digital, printed paper. Part of the reason is pretty much ubiquitous compatibility. If it needs to be edited, just don’t print it on digital paper. Does the format have other issues?

Here are a couple ideas: 1. Dividing some amount of text into pages on a computer screen is unnecessary and annoying. 2. Adobe has a stranglehold on the format and is constantly dicking around with it. Lately I encountered a fillable PDF that Acrobat Reader refused to fill. I could fill it with Firefox but after saving it was no longer a fillable form for any Acrobat user. What's the point of a fillable form that dis…

PDF is really a family of formats. There is the "good" (=sane) PDF, PDF/A-2, and then bunch of less good stuff (all the rest). PDF/A-2 doesn't have any interactive stuff, like forms or JS, and is a ISO standard that is not going to change under your feet. Because it is such mature and limited format, most readers should have no problem with PDF/A-2 files.

Re: CSS for printing to paper

#93
I've worked with this extensively on my site golfcourse.wiki, because I've build a tool that generates printable course books with CSS.

I originally was going to generate PDFs, but my backend is in python, and all the PDF generators have some issues with SVG images, especially with gradients. The site is a wiki, so SVG seemed like the best way to map courses while allowing them to easily be edited down the road. Since CSS and SVG work hand in hand, I decided to start working on that, and it's actually turned out okay.

If you want to see it in action, you can pop over and look at any of the courses marked with a blue or red flag on the homepage, but a very good example is Pasatiempo, here: https://golfcourse.wiki/print_options/course/pasatiempo_golf...

Re: CSS for printing to paper

#95
post #72

A 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.…

Wow, great use of the attr function, thank you!

That's a pretty common Accessibility best practice for print CSS!

Re: CSS for printing to paper

#96
post #72

A 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.…

Wow, great use of the attr function, thank you!

would recommend printing URLs in a very narrow font so they don't eat up the entire page

Re: CSS for printing to paper

#98

I 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…

> 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.)

Re: CSS for printing to paper

#99
I'm writing a book (https://news.ycombinator.com/item?id=38433668) and for the case study I built https://momenial.com to generate certificates for webinar attendees.

The certificate templates are HTML files, and I use https://github.com/cognitom/paper-css to make them print-friendly.

Re: CSS for printing to paper

#100
My company is working on a product simplifying the creation of printable PDFs filled with tables and charts, leveraging a visual designer and API. It helps with the usual headaches like page breaking, page numbering, table of contents, etc.

https://www.cx-reports.com/

We're working closely with early adopters at this stage.

Post reply on HN