Using headers and/or footers

You can use HTML to specify the header and/or footer contents and layout. Basically you can use all HTML tags, which are normalled allowed within the <BODY> tag (so don't use <HTML>, <BODY>, <HEAD> etc).

By doing so you'll get a lot of control over the layout of your header/footer. You can align it, use images, font styles, colors etc. Just make sure you have enough margin space for your header/footer to reside in.

As if full HTML is not enough to work with, we have also added the parameters in the below table, to ensure that you can use page numbering as well as display current date & time information.

ParameterDescription
%pagepage number
%frompagefirst page number
%topagelast page number
%romanpagepage number in Roman style (so I, II, III, IV, V etc)
%romanfrompagefirst page number in Roman style
%romantopagelast page number in Roman style
%urlURL that you're converting
%titletitle of the web page
%DDday of the month
%MMmonth of year
%YYYYyear
%hhhour
%mmminute
%sssecond

Using different headers and/or footers on different pages

Sometimes you maybe want to use a header or footer only on the first (or maybe last) page. Or maybe not on the first page? Well - we get you covered.

The below table shows you some classes that you can use to achieve this. By using them you control on which pages the header and/or footer shows up. Just assign them to an element to control where parts of your header/footer show up.

You can also wrap only part of the header/footer in one of these classes if you like. Everything that's not wrapped in one of these classes will show up on all pages.

ClassDescription
firstpageif you assign this class to an element such as a DIV, then it will show up on the first page
middlepagesif you assign this class to an element such as a DIV, then it will show up on the all pages in between the first and last page
lastpageif you assign this class to an element such as a DIV, then it will show up on the last page

Demo

Below we used some of the features described in the section to the left to give the PDF of this page a footer, which is right aligned, contains the current date and the page number in red.

Note that you have to properly URL encode the HTML if you're using this in a query string like below.

Download demo PDF!