The ideal print-to-PDF infrastructure would consist of a HTML-to-PDF service + a bunch of CSS styles. Unfortunately current browsers (which are used internally by pretty much all opensource HTML-to-PDF services) do not implement some of the web standards which are important for a decent PDF experience. Since browser vendors' prioritization is to some extent directed by what web developers are interested in, and there does not seem to be a lot of interest in print styles, it's important to express our interest. It would be also helpful for our internal long-term planning to track the development and implementation of print-related web standards.
The standards that seem most relevant:
- CSS Paged Media Level 3 - use of content property to populate page margin boxes + use of counter properties with @page (together these would allow page numbers)
- CSS Generated Content for Paged Media Module - use of target-counter() (together with the above it would allow for page numbers in a table of contents)
(A test page that uses these standards for page & TOC numbers can be found here.)
Less important but nice to have:
- CSS Regions (makes it possible to flow content into a series of containers which would make JS-based pagination very easy (cf. fiduswriter/pagination.js), so this is an alternative to the above two; but a lot more complicated so less likely to be implemented anytime soon)
- CSS Generated Content for Paged Media Module - use of bookmarks (the CSS way to create PDF outlines)
- CSS Generated Content for Paged Media Module - use of leaders (the ...... thing in tables of content; can be done in other ways with some hacking so not really important)
Other relevant standards:
- CSS Page Floats
- CSS Fragmentation Module Level 3
- CSS Figures and CSS Books (seems to be the WHATWG equivalent of Page Floats and Generated Content for Paged Media)
- CSS Pagination Templates Module Level 3
Current browser status & plans:
- Chrome:
- platform status: GCPM (nothing), Regions (dropped), Fragmentation (nothing). The rest doesn't even seem to be on the horizon.
- issues: #368053 Paged Media (also #320370 and #697079); filed two bugs about our specific use-case: #740496 (page numbers) and #740497 (TOC numbers).
- Firefox:
- issues: #286443 Paged Media (also #1117798)
- WebKit:
- only browser to support CSS Regions
- issues: #15548 Paged Media (also #85062),
- IE:
- feature requests: Paged Media, GCPM