6 ms·
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 p
by Jaruzel 10y ago
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...
- NicoJuicy 10y agoI don't think this is CSS3, it has been arround for ages ( you will be using this when convert html pages to pdf also ;) )
- adrianN 10y agoIE 4.0 supports it...
- amichal 10y agoYep. 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.
- babuskov 10y agoI recall using those in 2002 or somewhere around that time. :)
- vanderZwan 10y agoAnd 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.
- dspillett 10y agoWhen 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.
- danvdragos 10y agoYes, 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/ https://www.w3.org/TR/css3-page/
- Roritharr 10y agoThe 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/ https://www.princexml.com/ ) , which is commercial and rather pricey.
- _phazor 10y agoWhat about Chrome? File -> Print -> Save as PDF. Works fine with these print properties as far as I can tell.
- matthewmacleod 10y agoI'm pretty sure that wkhtmltopdf supported these too, last time I used it, though it's been quite a while now.
- JoelSanchez 10y agodompdf supports this.
- haar 10y agoPhantomJS supports it too (either through `html-pdf` or manually).
- Roritharr 10y agoI was looking into PhantomJS, this must be added since then. Great!
- addedlovely 10y agoCheckout https://docraptor.com/ https://docraptor.com/ - it's great - is commercial but affordable.
- TimMeade 10y agoThis looks interesting. Thanks, we are going to try it out.
- 10y ago
- k1m 10y agoThere'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 https://www.youtube.com/watch?v=854Csokl3QA and some notes in our blog: http://blog.fivefilters.org/post/75603097111/pdf-newspaper-2-5 http://blog.fivefilters.org/post/75603097111/pdf-newspaper-2... The software itself is free to try at http://fivefilters.org/pdf-newspaper/ http://fivefilters.org/pdf-newspaper/
- danvdragos 10y agoWhat 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?
- k1m 10y agoA 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.
- danvdragos 10y agoYes, 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...
- deleted 10y ago[deleted]
- qznc 10y agoColumns 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 http://pp.ipd.kit.edu/~zwinkau/acm_html/test.html [1] http://pp.ipd.kit.edu/uploads/publikationen/buchwald10cases.pdf http://pp.ipd.kit.edu/uploads/publikationen/buchwald10cases....