Live data from Hacker News

Show HN: Gutenberg – Modern CSS framework to print the web correctly

github.com

21–30 of 62 posts

Re: Show HN: Gutenberg – Modern CSS framework to print the web correctly

#21
post #18

Earlier quoted context omitted.

The problem with those, the last time i checked, was that most html to pdf solutions don't support them. The only one I could find was Prince ( https://www.princexml.com/ ) , which is commercial and rather pricey.

PhantomJS supports it too (either through `html-pdf` or manually).

I was looking into PhantomJS, this must be added since then. Great!

Re: Show HN: Gutenberg – Modern CSS framework to print the web correctly

#22
post #19
post #4

Wow, today I learned (via this) about: page-break-before: page-break-after: Did not know these were in CSS3 ! It's always worth poking around in others peoples code...

There's a lot of nice things you can do in CSS for printing. I worked on a project to make web articles printable. The last version focused more on doing the printing via the browser using CSS for creating columns. Here's a video demo: https://www.youtube.com/watch?v=854Csokl3QA and some notes in our blog: http://blog.fivefilters.org/post/75603097111/pdf-newspaper-2... The software itself is free to try at http://fiv…

What is it useful for? I saw someone on medium saying they would pay for software that turns his posts into a book but more than that?

Re: Show HN: Gutenberg – Modern CSS framework to print the web correctly

#23

Earlier quoted context omitted.

The problem with those, the last time i checked, was that most html to pdf solutions don't support them. The only one I could find was Prince ( https://www.princexml.com/ ) , which is commercial and rather pricey.

Checkout https://docraptor.com/ - it's great - is commercial but affordable.

This looks interesting. Thanks, we are going to try it out.

Re: Show HN: Gutenberg – Modern CSS framework to print the web correctly

#24
post #4

Wow, today I learned (via this) about: page-break-before: page-break-after: Did not know these were in CSS3 ! It's always worth poking around in others peoples code...

The problem with those, the last time i checked, was that most html to pdf solutions don't support them. The only one I could find was Prince ( https://www.princexml.com/ ) , which is commercial and rather pricey.

webkittopdf supported them just fine. And so does phantomjs when printing pdfs IIRC.

Re: Show HN: Gutenberg – Modern CSS framework to print the web correctly

#25
post #4

Wow, today I learned (via this) about: page-break-before: page-break-after: Did not know these were in CSS3 ! It's always worth poking around in others peoples code...

I don't think this is CSS3, it has been arround for ages ( you will be using this when convert html pages to pdf also ;) )

Yes, CSS3 has a new module CSS Paged Media Module [0]. This should eventually replace XSL-FO for formatting for print. What I don't understand is who finds these useful anymore? except big enterprises like telecoms with dying legacy requirements. Those requirements will get totally replaced by web... Maybe there is still a niche for archiving with PDF/A

*Maybe publishers that don't want to be locked in with a single formatting tool (indesign)

[0]https://www.w3.org/TR/css3-page/

Re: Show HN: Gutenberg – Modern CSS framework to print the web correctly

#26
post #19

Earlier quoted context omitted.

There's a lot of nice things you can do in CSS for printing. I worked on a project to make web articles printable. The last version focused more on doing the printing via the browser using CSS for creating columns. Here's a video demo: https://www.youtube.com/watch?v=854Csokl3QA and some notes in our blog: http://blog.fivefilters.org/post/75603097111/pdf-newspaper-2... The software itself is free to try at http://fiv…

What is it useful for? I saw someone on medium saying they would pay for software that turns his posts into a book but more than that?

A better reading experience. If you like to print articles to read offline, you can either rely on the publisher's own print stylesheet, or use an application like ours.

It uses the same formatting for all articles and adds columns. It's not a CSS framework like Gutenberg, the one posted here, which is intended for publishers to make their own content more printer friendly. PDF Newspaper tries to extract the relevant article content from any given page and then apply its own standard formatting on that and make it printable with our own printer stylesheet.

Re: Show HN: Gutenberg – Modern CSS framework to print the web correctly

#27

When trying to print the modern style, I'm only getting a blank page with lines: https://imgur.com/a/MoGnf

It is because the fonts are not loaded. The print mode handles it in this way, I will see how I can fix that, thanks!

Re: Show HN: Gutenberg – Modern CSS framework to print the web correctly

#28

Where are word breaks (word splitting if not fit for page), justify alignment? Variable spaces between letters? Is this possible with CSS? I'm trying to typeset a long text on the web and I'm not happy about how it looks compared to LaTeX and PDF. (it's straight out awful)

Unfortunately, `hyphens: auto;` is still not supported on Chrome Windows. I still recommend using it, as it brings nicer layout to the ones you can see it (http://caniuse.com/#search=hyphens) and does not break the layout for others.

CSS Text 4 drafts might bring massive improvements for text handling and will give more fine grained controls over hyphenation, such as `hyphenate-limit-lines` (https://drafts.csswg.org/css-text-4/#hyphenate-line-limits), but obviously this is nothing that will make it to stable browsers in the near future. Still, the changes that might come for CSS with this draft would bring it a lot closer to LaTeX or InDesign.

Re: Show HN: Gutenberg – Modern CSS framework to print the web correctly

#29

Where are word breaks (word splitting if not fit for page), justify alignment? Variable spaces between letters? Is this possible with CSS? I'm trying to typeset a long text on the web and I'm not happy about how it looks compared to LaTeX and PDF. (it's straight out awful)

The justified alignment looks sub-par in places, like in the middle of the first paragraph of the example pages. Flush left alignment normally is the better option, if you don't have a hyphenation engine.

Browser inserted Soft-Hyphens could fix this, but since they are language dependent browser support is spotty: https://developer.mozilla.org/en/docs/Web/CSS/hyphens#Sugges...

By itself most browsers can break soft-hyphens pretty reliable, but they have to be generated first: See https://github.com/mnater/Hyphenator or https://github.com/bramstein/hypher

Re: Show HN: Gutenberg – Modern CSS framework to print the web correctly

#30

Earlier quoted context omitted.

I don't think this is CSS3, it has been arround for ages ( you will be using this when convert html pages to pdf also ;) )

And yet almost every time I try to print a page, it thinks it's ok to just split an image over two pages. It baffles me that this is the default.

When I've seen this it has been browser specific, though I can't remember which way around (in fact it might be sometimes one that does and sometimes the same one that doesn't...) so if you get odd printing results with Chrome try in FF (or vice versa, or add Edge into the mix if on Windows, or ...).

Printing can be quite a faf from web pages.

Post reply on HN