5.6. Customizing for PDF Export

Fanurio can export an invoice to PDF because it uses a software library that converts (X)HTML to PDF. This means that the same template that is used to export an invoice to HTML can also be used to export to PDF.

If you are using a template to export to PDF, there are a few settings that you could add to the template to make the PDF document look more nicely. These settings are actually CSS 3 page rules.

The following document has two A4 pages with portrait orientation and a 0.25 inch margin. A black border is drawn around the pages to emphasize the content.

<html>
<head>
	<title>PDF Test</title>
	
	<style type="text/css" media="all">
		@page {
			size: A4 portrait; /* can use also 'landscape' for orientation */
			margin: 0.25in;
			border: thin solid black;
			padding: 1em;
		}
	</style>
</head>
<body>
	<p>Page 1.</p>
	
	<p style="page-break-after:always;"/>
	
	<p>Page 2.</p>
</body>
</html>

Note: Not all CSS3 page properties are supported yet by Fanurio when converting to PDF.