Add page numbers to PDFs of custom themes

Page numbers can be added to PDFs of multi-page transaction forms and statements by including appropriate code in a custom theme. This is in addition to repetition of transaction header information included by default on PDFs of all themes.

The purpose of this Guide is to furnish basic information about how the page number feature is implemented. We will not furnish detailed coding instructions on how to control placement and style of page numbering. Users are responsible for coding and debugging their own custom themes. This Guide offers only a couple examples to get you started.

Page numbers are automatically included on PDFs of multi-page reports, which are not affected by themes. (Customer and supplier statements are exceptions, because they are displayed according to the theme selected.)

When generating a PDF, Manager looks for the exact HTML comment tag, <!--Page Counter—>, in your theme. By incorporating this tag in your Liquid theme, you can control where the page numbers will be positioned and how they will be presented (colors, font size, alignment etc.) The page numbers will appear in the format Page X of Y.

For example, you can customize the default, Plain, theme by adding the following three lines between the </tbody> and </table> tags near the end of the theme code:

         <tr><td colspan="99" style="text-align: center"><!--Page Counter--></td></tr>

The theme code would look like this:

Resulting transaction forms using the custom theme will not show page numbers on screen, because lengthy forms are not paginated on screen. But when you generate a PDF, the page counter will show at the bottom center of each PDF page:

Likewise, if you are using the Glossy Green theme and want to show the page counter in the top right corner in a green color, you could add the <!--Page Counter--> comment tag to the beginning of the theme:

Subscribe to Updates

Subscribe to our newsletter and get exclusive product updates you won't find anywhere else straight to your inbox.

© 2022 — Based in Sydney, Australia but providing goodness globally