The following code is adapted from Mozilla's grid documentation. The example creates a grid container that contains five child divs. When I run Prince from the command line and attempt to build a PDF, I see the following error and a PDF is not generated: "prince: lab_report.css: warning: unsupported properties: grid-template-columns"
This simple document aims to show just how easy it is to generate PDFs from HTML+CSS using Prince. The document mostly uses Prince's built in styles for HTML, but it also applies some custom styles. The custom styles: center the title and subtitle, choose fonts and specify the style for the hello world exclamation below.
Our hypothesis is that generating PDFs using Prince is easy. By using a
simple document containing only
h1
, h2
, h3
, p
,
code
, pre
, ul
and
li
tags and a simple stylesheet we will generate a PDF that looks good.
$ prince style.css lab_report.html
Hello World!
If you're currently looking at a PDF file then this works.
The resulting file includes a title and subtitle (centered), a list of the apparatus needed. The resulting file uses a sensible-looking a sans-serif font except for the code tags which use a monospace font and the Hello World exclamation which has serifs.