Context:
XSL-FO is not dead…
But not many people want to work on it today. …
CSS for print is not total crap …
We’re making CSS better …
Here are some notes on whether & how to move.
Until now
A “traditional” way from XML to print:
We want to format XML with CSS:
CSS is really meant for styling HTML …
CSS is really meant for styling HTML …
Transform to XHTML and then apply CSS:
@page {
size: A4;
/* or,
* width: 21cm;
* height: 29.7cm;
*/
}
@page:left {
@top-left {
content: "Page " counter(page);
}
}
@page:right {
@top-right {
content: "Page " counter(page);
}
}
div.contents ul li a:after {
content: " " leader(dotted) " " target-counter(attr(href, url), page);
}
<div class="contents">
<h1>Table of Contents</h1>
<ul><li><a href="#preface">Preface</a></li>
<li><a href="#c1">Chapter One</a></li>
</ul></div>
Table of Contents Preface . . . . . . . . . . . 7 Chapter One . . . . . . . . 11
All images are from fromoldbooks.org (an image site maintained by the author of this presentation) or by Liam Quin, except the viewport illustration from XSL-FO and the Open Web Platform logo from openwebplatform.org.