Live data from Hacker News

CSS for printing to paper

voussoir.net

101–110 of 139 posts

Re: CSS for printing to paper

#101

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

> You should use Letter or A4 as appropriate for your relationship with the metric system.

That's pretty clearly stated near the top of the article. As a European, if I wrote a similar post I would do it all in metric and trust that my US readers were smart enough to substitute the units of their choice without whining about it. The concepts would not change, and a quick google would tell you that an inch is approx 25mm, which is enough for you to understand what's going on.

Re: CSS for printing to paper

#102

Earlier quoted context omitted.

I imagine to avoid paying expensive license fees, to stick with OSS out of principle, and/or to implement various fun integrations.

oh to be young and a dreamer. now, i just want to get work done with the most efficient tool for the job. that kind of hell is for the young

I just worry that the growing generations don’t degrade typesetting quality too much… Not that it’s particularly stellar in the mainstream, but I sure hope it wouldn’t get even worse!

Re: CSS for printing to paper

#103
I appreciated the read, but in practice I just link to the css file in Paper-CSS.

It may not be a lot of CSS, but it is much easier for me to just include the page and have it deal with my page size than to review articles like this when I want to print.

Edit: when I linked to the repo, my comment disappeared. You can find Paper-CSS by searching Github or Node for cognitom/paper-css.

Would love a more experienced HN'ers tip to how to use links in comments w/o causing the comments to disappear.

Re: CSS for printing to paper

#104

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.

-

Re: CSS for printing to paper

#105
post #104

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.

-

Fixed. Thanks!

Re: CSS for printing to paper

#106
Haha one of the examples has this text:

    By reading this sentence, you hereby agree to all terms and conditions
    presented by voussoir.net, including but not limited to terms which entitle
    voussoir.net to a fraction not less than forty (40) percent (%) of your
    monthly income from now until an as-yet undetermined time not less than
    thirty six (36) months from the present date.

Re: CSS for printing to paper

#107

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

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

#108
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.…

This is nice, I learned a couple of new tricks. The attr one is great.

For many years now, and alongside my "regular" CV, I've had a Markdown to PDF script that uses @page and @media in a small HTML template and essentially creates custom 1-pagers in US format. Instant recruiter turnaround.

In between this and the OP's table splitting trick, this was a good 15m spent on HN.

Re: CSS for printing to paper

#109
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!

If the anchor tag already has the URL as text, then will the URL be printed twice?

Like if I've got

  https://www.google.com/
Will it print like this?

  https://www.google.com (https://www.google.com)
Post reply on HN