Documentation
Difficulty level:
Configuration - Templates - Template Sections
Template blocks - Examples - Engine WKHTML
Blocks (template sections) with fixed information can be included in PDF templates. Consider a footer with, for example, page numbers or a header. Below are examples of such blocks.
If it is necessary to set a head or css block, the contents of the "head" and "css" blocks themselves have a full html structure, the contents of the <head> container is stripped and comes inside the <head> tags of the new body html and must be valid.
The header and footer must start with the <!DOCTYPE html>
Header
A header with logo:
The margin above and below indicates how much space the header will have; With a margin of 0 they are therefore not visible!
Using 35, for example, usually produces a clearly readable header.
Using 35, for example, usually produces a clearly readable header.
<!DOCTYPE html> <HTML> <HEAD> </HEAD> <BODY style="margin: 0 0 0 0; border:0;"> <table border="0" width="100%"> <tbody> <tr> <td> <div style="margin-top:0; margin-bottom:0px;"><img alt="" src="https://klant.i-reserve.net/user/media/klant/images /BWP%20LOGO%202019/BWP_LOGO.jpg" style="width: 1260px;" /></div> </td> </tr> </tbody> </table> </BODY> </HTML>
Footer
A footer with page numbering:
The margin above and below indicates how much space the footer will have; With a margin of 0 they are therefore not visible!
Using 35, for example, usually produces a clearly readable footer.
Using 35, for example, usually produces a clearly readable footer.
<!DOCTYPE html>
<HTML>
<HEAD>
<script>
function subst() {
var vars = {};
var x = document.location.search.substring(1).split('&');
for (var i in x) {
var z = x[i].split('=', 2);
vars[z[0]] = unescape(z[1]);
}
var x = ['frompage', 'topage', 'page', 'webpage', 'section', 'subsection', 'subsubsection'];
for (var i in x) {
var y = document.getElementsByClassName(x[i]);
for (var j = 0; j < y.length; ++j) y[j].textContent = vars[x[i]];
}
}
</script>
</HEAD>
<BODY style="margin: 0 0 0 0; border:0;" onload="subst()">
<div style="text-align:center; font-size: 16px; color: #AAAAAA; width:2100px;"> Page <span class="page"></span> from <span class="topage"></span> </div>
</BODY>
</HTML>
CSS
A block of CSS:
<html>
<head>
<!-- example CSS Styles should always start and end with a style tag. -->
<style>
hr {
color: sienna;
}
p {
margin-left: 20px;
}
body {
background-image: url("images/back40.gif");
}
</style>
</head>
<body>
</body>
</html>
HEAD
A block with html HEAD content:
<html> <head> <link href="https://fonts.googleapis.com/css?family=Raleway" rel="stylesheet"> </head> <body> </body> </html>
This page is based on the engine WKHTMLPDF





