Prince XML: Generating High Quality PDFs from HTML + CSS

Google TechTalks · 39K views · 2007 · 1:02:32

Open on YouTube

Web developmentGraphic design & typographySoftware (other)talkdated

Why Stack Overflow recommends it

Stack Overflow users link it when answering or asking how to convert HTML and CSS to good-quality PDF, as a primer on the Prince tool and its CSS3 print support.

Recommended by 1 people across 1 different months, 2009 to 2014.

What it is

A 2007 Google Tech Talk in which Håkon Wium Lie (CSS's inventor) and Michael Day of YesLogic present Prince, a program that turns HTML, XML and CSS into print-quality PDFs. They cover CSS Paged Media support, data-driven documents for server software, and typesetting books and papers from web markup.

Cited in 2 Wikipedia articles, including Håkon Wium Lie, Prince (software).

What people said

Recommends crb · 2009-02 · Stack Overflow · on “Generate PDF from ASP.NET from raw HTML/CSS content?”

This sounds like a job for Prince [LINK] . It can take HTML and CSS and generate a PDF, which you can then present to your users. It supports CSS3 better than most web browsers (staff include Håkon Wium Lie, the inventor of CSS). See the samples [LINK] , especially the ones for Wikipedia pages, for the beautiful output it can generate. There's also an interesting Google Tech Talk [this video] with the authors. Edit: There is a .NET wrapper [LINK] available.

Cites cletus · 2009-04 · Stack Overflow · on “how to preserve the look and feel when converting HTML to PDF”

From Convert HTML + CSS to PDF with PHP? [LINK] I found out about Prince XML [LINK] , which has clients for lots of languages [LINK] including the .Net platform. It is an exceptional converter though commercial and not cheap. There is a Google Tech Talk [this video] about it. Allegedly, Google uses it for Google Docs [LINK] . It's rendering engine also passed the Acid2 test. If you want high-quality HTML to PDF conversion and are willing to spend the ~$3800 for a server license then look no further. Frankly I think the cost in time of getting anything else to do what Prince does will quickly outstrip the cost involved. Developer time is expensive.

Cites Kurt Pfeifle · 2010-08 · Stack Overflow · on “(HTML + CCS3 Generated Content for Paged Media) to PDF?”

They only application I know of that can possibly convert HTML/CSS3 to good quality PDF is PrinceXML [LINK] . (And it is my impression, that Google licensed and utilizes their code somehow in GoogleDocs for PDF export.) However, this is a commercial application, and I think it comes with a hefty price tag. One of it's leading lights is Håkon Lie, who is also behind all the technical achievements of the Opera web browser. Here is a 2 years old Google Tech Talks video where Lie outlines some of the technologie behind PrinceXML: [this video]

Cites qed · 2014-09 · Stack Overflow · on “Convert html containing mathjax markups to pdf”

I have come across a tool called princexml that can convert html+css into pdf beautifully ( see this video [this video] ). With this it's even possible to write a PhD thesis using entirely html+css and get a nice pdf output in the end. But it seems it does not handle mathjax well. I guess this is because the mathjax part much be rendered in a browser first. So I have a simple html file like this: <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <title>test math</title> <style type="text/css"> </style> <script src=' [LINK] ' type='text/javascript'> MathJax.Hub.Config({ HTML: ["input/TeX","output/HTML-CSS"], TeX: { extensions: ["AMSmath.js","AMSsymbols.js"], equatio