Paged.js: Paginating content and making books in the browser
pagedmedia.org
pagedmedia.org
The issues I had were mostly to do with converting to pagination and I decided that in practice it just wasn't worth it.
The problem is that pagination on web pages just doesn't work. People have figures and so forth that need new page breaks to properly work.
CSS has extensions for this but the problem is that no one uses them because they're not intending their pages to be printed or paginated.
I have more work on this if you're interested:
https://getpolarized.io/2019/10/06/Whats-Next-For-Web-Captur...
https://getpolarized.io/2019/05/11/portable-web-documents.ht...
... I've decided to just migrate all this work for EPUB for various reasons but I'm also going to migrate to one continuous 'page' due to the CSS pagination issues I mentioned above.
Document management, and saving web pages is a huge deal and something that I have been looking for a solution for but which until now I have not found anything that would quite fit, and most of the ones I have looked at and seriously considered would require too much integration work and customization to be usable. But Polar looks really really promising!
I have avoided Electron based software until now for the same reasons you often find people echoing in the HN comments section when the topic comes up, but for Polar I would make an exception because it looks to be perfect for me so I am willing to sacrifice some of my precious RAM for Polar and am willing to accept a certain degree of UI and performance problems that I associate with Electron based apps.
Since a web browser extension is in the works though, would you recommend that I wait until that is released or should I start using the Electron based app now and then migrate/switch?
Thanks... 2.0 should come out next week too so it's going to be interesting to see how the community responds.
Here's more on the release:
https://www.reddit.com/r/PolarBookshelf/comments/du68gf/plan...
The browser version is almost on par in terms of features with the desktop version. The main features that we're missing in the web version are offline support (which will be resolved soon), support for syncing with Anki, and web capture.
We're working on porting web capture to completely run within the web extension though. I think the web version should be completely on par with the desktop/web version in the next month or so.
Also, it's really not THAT much of a resource hit. On my machine it burns like 100MB or RAM and say 300MB of disk space.
Use chromium and try to print to see the whole thing in action.
I see the tiny zoomed out 2x2 layout of the page, but if I try to zoom in, it zooms in on the abyss.
And if I try to pan while zoomed in, it zooms back out to the illegible zoomed out view...
-
Actually the more I play with it, the more interesting the way it breaks are.
I was able to zoom in when I scrolled down first, and very inefficiently pan around the 2 column view, but if I pan too far, the zoom resets.
And sometimes I just end up being taken to the abyss again.
Which I figured out is way off in the right margin.
I think I will stay away from this for now.
In action with glitch: https://printing-in-relation-to-graphic-art.glitch.me/
The embedded links and ads everywhere we look just throw garbage all over the place too, or else published news articles might match pretty well
I would be so happy if this polyfill takes off!
I hear you emphasizing this might just be for print, but something like a Kindle in-browser reader (hidden nav; spacebar or < or > to turn a page) can also provide a nice experience (different to scrolling) in reading longer works.
In general - why does the Web need this? This is a less-flexible CSS grid, with some auto-increment and @media(print) styles mixed in.
The use case for faithfully representing a textual work is not convincing - this can be done already, more accurately, and in a far less complicated manner by using images or PDF or any other format more suited than hypertext markup and CSS.
We already have pagination on the Web, it's called a webpage.
This just feels so wrong and not what a Web document should be: https://www.w3.org/TR/css-page-3/
I don't get the appeal. This isn't anything like a book, since I'm still scrolling, squinting, and reading words from a backlit screen instead of a physical page. Not to mention, using the browser's zoom functionality just straight up doesn't work (the pages and text stay the same size). So much for accessibility?
I really dislike everything about this.
[0]: https://s3.amazonaws.com/pagedmedia/pagedjs/examples/index.h...
[1]: But actually, JS is supposed to be pretty fast nowadays - so let's not build this bloat into the browser's rendering engine please?
I don't see any evidence on their website this is intended for reading in the browser, and tons of clues that it's intended for printing books from the browser. I mean, there are tools for physical page sizes, blank pages, front/back matter, page counters, etc. Things that make zero sense in the browser and are necessary for a nice book printing.
So, what makes you think this is intended for reading in web browsers? As you note, it's horribly unpleasant in a browser...seems like they would have noticed that if they were testing in the browser, rather than using it to print books.
print is just another aspect of responsive web design. And paged.js add the possibility to add things that the paper need and the browser don't (page number, cross rereferences, running-head, etc.)
A bit more info about css print: https://www.smashingmagazine.com/2018/05/print-stylesheets-i...
We're sending webpages to printing press, and it becomes a book. That's it.
You would either use this for stuff that is only useful printed (e.g. a boarding pass could be HTML instead of PDF) or as secondary, print-specific styling for web content that is frequently printed to paper.
It's definitely made to print books and pages from the web. You can preview in a browser, but that's not the goal. It's a polyfill for CSS properties made for print.
Although, you can't tell for sure what people want to do with tools and library right? :)
HTML is already exceeding good at flow layout, we can flow text into desktop, mobiles. Why not extend the rules so they flow into a piece of A4 document, or two columns?
Another use case is reports, where there are tabular data, where headers should be repeated at the top of every page. Wouldn't it be nice if HTML/CSS could specify this instead of resorting to Crystal Reports? It'd certainly make us doubly productive.
To me, a web browser's purpose is to render markup into something useful for a user, dependent on variables like screen size, user preferences, browser zoom, accessibility needs, etc. A browser's purpose is not to render-a-document-as-an-A4-printout-specifically,-because-no-other-format-will-do.
"Make it look exactly like this" is not an expectation we can or should have about web browsers, and this proposal is an attempt at that.
Anyway, to specifically address your use cases:
> The use case is when I buy a plane ticket it comes with a 3 page receipt and E-ticket, and rather than downloading a PDF, we can have HTML specify how to flow the document into a document
HTML can already specify that document. Why does the browser care that it would be 3 different physical pages? Why would a user care? We're letting the tail wag the dog - just put the information in HTML.
> Why not extend the rules so they flow into a piece of A4 document, or two columns?
Two-column layouts are a concession of print formats due to constraints of needing to get all the other content onto the physical page. We don't have those constraints in Web, there's no need to introduce them.
> Another use case is reports, where there are tabular data, where headers should be repeated at the top of every page. Wouldn't it be nice if HTML/CSS could specify this instead of resorting to Crystal Reports? It'd certainly make us doubly productive.
If we're spinning up this whole AlmostPostscript.js thing to render a <table> with a sticky header, I really don't want to be a modern web developer anymore.
And sure, paginating fixed content is easy. Paginating dynamic length content? Having poked around at the problem, I'm very curious to give this library a try.
Currently, this requires you to use something like pandoc to generate LaTeX and HTML from the same source document, then use two different languages for styling. I don't want to do that. I want to have a single HTML file with one stylesheet that applies a few extra rules to print nicely. I can sort of do this now, but there are lots of features missing that make it impractical for many use-cases. For example, it's currently impossible to make a footnote always display at the bottom of a print page in CSS alone.
@julie_b @fredjc and myself are working on paged.js and we'll be happy to answer any question you may have :)
We're in https://mattermost.pagedmedia.org/ :)
Come play with us :)
We currently have a browser extension you can test here: https://pdf.fivefilters.org/simple-print/
I understand that some people may not care about Firefox, but can you at least not break things for it?
Why would I want to make a browser act like a book? Or vice versa? Didn't we kinda try this with Flash? And didn't we realize they are two different mediums?
But Firefox is now looking at this, and Safari too. I hope we'll get to support more browsers soon enough (Firefox is my daily driver)