Interview with Håkon Wium Lie

Håkon Wium Lie talks about CSS printing, its history, and Prince

Today I am more than a little excited to share an interview I conducted over email with Håkon Wium Lie.

Håkon is the inventor of CSS, you may know him by the name howcome online. Here is a quick overview from his page on the Prince website.

I’m the chairman of of YesLogic, the company that makes the Prince formatter, which turns HTML and CSS code into beautiful PDF documents. I’m also the person who came up with the idea of CSS in 1994. From the outset, CSS was designed to describe printed documents and the specifications have gradually been extended to support features like page numbers, footnotes, and running headers/footers.

Honestly, when I contacted Prince to ask if I could interview one of their technical folk for my book on Print Stylesheets I had no idea Håkon would respond to my email, or indeed be interested in answering my silly questions!

Who better to ask about CSS printing though, than the person who created it?

Without further ado, onto the interview.

When you were thinking about CSS originally, did you ever think folk would be writing books that required CSS in order to be published? Or for that matter using it to animate their websites?

Printing was always part of CSS in my head.

Our civilization is based on paged documents and having a stylesheet language that couldn’t print would be a wasted opportunity for the web and for our world.

Animation is different. We already had animated GIFs and doing more of those wasn’t so compelling. Of course, now that we have seen the wonderful animations one can do with CSS, I’ve changed my mind on that topic :)

Perhaps we should add a -flipbook command-line option to Prince to support printed animations? :)

My main focus right now is print stylesheets on the web, do you believe they are a necessity in 2017 or should we ignore paper?

Both, actually! In many cases, people use print stylesheets to generate PDF for archival purposes and the documents are never printed on paper. That’s fine – archives are important. But there are cases when nothing beats having information printed on paper. For example, when your phone has run out of power and you need to check your travel itinerary. Or, when you want to sit back and read a physical book with beautiful layout. Our civilization will continue to use paper for many years to come.

The perception a lot of developers have is that printing the web is at best nice to have and they don’t have time to add the functionality. Do you think this is a fair stance?

It’s a fair first approximation. But in round two, printing should be tested – or one should offer a PDF download option. Some pages are too dynamic for this to make sense, but – as a rule of thumb – if you have more than a paragraph of text, you should make sure it prints decently.

That rule of thumb makes a lot of sense. Why do you think browsers have been slow to support things like paged media?

As the CTO of Opera for 18 years, I tried to push printing and the paged media specifications. However, getting printing and pagination right is a hard problem, and there are no paying customers. Also, browser benchmarks tend to focus on speed rather than, say, printing, so there’s little support there.

My solution was to join the board of YesLogic, the maker of Prince. This way, I could both have a fast browser and a beautiful PDF generator.

Excellent segue! CSS isn’t confined to the browser of course. Using tools like Prince you can generate PDF documents with HTML and CSS, can you give me a real quick overview of how you got involved with the project and what it’s aims are?

In my head, printing has always been a part of CSS. The first CSS proposal in 1994 even had some sample code:

print.head.align.style = right

CSS2 introduced paged media, page breaks and such. However, as you noted, browsers were slow to add print-oriented functionality. In 2000, I asked for a HTML+CSS->PDF formatter.

I don’t think Michael Day saw that message, but he and his team created Prince anyway and YesLogic was founded in 2002. Prince was announced in 2003.

At the time, Bert Bos and I were working on a new edition of our CSS book and we thought it was time to format the book itself in CSS. Prince was a marvellous tool, the only thing that could create print-ready PDF files at the time. I joined the board of YesLogic in 2004, to make sure my favourite bugs were fixed. The book came out in 2005.

I’ve been working on the web for years and have written for various print publications and only heard about Prince whilst I was researching this latest book, do you think HTML + CSS outside of the browser have a marketing issue?

We have told people about this, e.g.

So, those who need a HTML+CSS->PDF formatter tend to find us. However, there’s probably lots of potential users out there that do not know such formatters exist. As such, your book is most welcome.

If you could have one print-related wish come true, what would it be?

Can I have three wishes? We need solid support for sidenotes, baseline alignment, and top/bottom-floating figures with snapping to nearest edge. The features are sketched here, but implementations are still lacking.

Who are some people doing amazing work in the print space, or with CSS in general that people should be aware of?

Imenupro uses Prince to create mouth-watering menus and Lea Verou’s book is cool.

Toby’s Note: Here are some direct links to buy Lea’s book in the UK and in the US.

For someone who has been converted to wanting their documents to print well, what resources would you share with them?

Start by looking at some of the samples that exist

End of Interview

Thanks so much to Håkon for taking the time out of his day to talk to me about this stuff. As well as all the links above you can follow him on Twitter.

If you’re interested in finding out more about my book on Print Stylesheets, you can head on over to Print Stylesheets.

Recent posts View all

Talk CSS

FrontEnders - Web Performance

Sharing some of my thoughts on a FrontEnders meetup on the topic of Web Performance

Conferences

Tips for how to ask for time off to attend conferences

Asking for time off to attend a conference can be nerve-racking, these tips will get you closer to attending the conferences you're interested in.