Live data from Hacker News

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

github.com

31–40 of 62 posts

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

#31
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…

Columns are tricky.

Once I tried to convert a paper in ACM style into HTML [0]. It seems to work today. A few years ago, Chrome broke columns in printing mode.

What I still cannot do is the copyright notice, which for ACM style must be at the bottom of the first column (see example [1]). This would require something like absolute positioning relative to a printed page.

[0] http://pp.ipd.kit.edu/~zwinkau/acm_html/test.html [1] http://pp.ipd.kit.edu/uploads/publikationen/buchwald10cases....

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

#32
post #26

Earlier quoted context omitted.

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…

Yes, columnar reading is something special. Reminds me of ACM communication magazine. Though this must be a very small niche with web being so convenient - just click any link and read it...

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

#34

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.

Docraptor is just the SaaS version of PrinceXML, the underlying software is the same. Much more affordable for small jobs though!

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

#35
post #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-h…

It really baffles me that some formatting engines require that soft-hyphens be pre-inserted. For eBooks, particularly. Apparently Kindle supports hyphenation only if the book has explicit soft-hyphens. Google Books doesn't seem to support it at all. Meanwhile, FBReader does a perfect job of hyphenating arbitrary ePubs. TeX has done it right since what, 1983?

Yes, hyphenation is language-specific, but if your application is laying out blocks of text, a set of hyphenation tables is a basic part of language support.

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

#36
post #9

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

IE 4.0 supports it...

Yep. Before that we used to wrap things in table cells to simulate page-break-avoid. This mostly worked. "Orphan" control was impossible at the time. I think most of the browsers do an ok job. Price ml does it all. Including things like toc generation and forcing sections to start on the front of a piece of paper or have a gutter in the "inside" of the page.

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

#37
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.

weasyprint supports it

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

#38
post #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.o…

I find it sad that what has been holding this back for years is "how will we download dictionaries":

https://bugs.chromium.org/p/chromium/issues/detail?id=605840

Especially considering LaTeX had this right for decades - and it is one of the major issues for good and pleasant readability... sigh.

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

#40
This is nice, though I was hoping to find a framework for print-based layout when I saw this. I have projects that utilize the printer as an output and I struggle to find the proper way to lay out the content effectively. I have had hopes for flexbox, but it seems to fail in various parts of the pipeline.
Post reply on HN