Skip to content

Instantly share code, notes, and snippets.

Last active September 21, 2018 07:11
What would you like to do?
A sample PDF template showing off the pagebreak support
* Template Name: Example Pagebreak
* Version: 0.1
* Description: A sample PDF template showing off the pagebreak support
* Author: Gravity PDF
* Group: Example
* License: GPLv2
* Required PDF Version: 4.0
/* Prevent direct access to the template (always good to include this) */
if ( ! class_exists( 'GFForms' ) ) {
@page {
footer: html_pagenumbers;
@page rotated {
size: landscape;
@page a5{
sheet-size: 148mm 210mm;
footer: html_blank;
<htmlpagefooter name="pagenumbers">
<div style="text-align: center;">
<!-- Empty footer so we can effectively turn footers off -->
<htmlpagefooter name="blank"></htmlpagefooter>
<p>My content here...</p>
<!-- Basic Page Break -->
<p>This is on a new page</p>
<!-- Reset the page number back to 1 -->
<pagebreak resetpagenum="1"/>
<!-- Reset the page number to 5 -->
<pagebreak resetpagenum="5"/>
<!-- Page Break with page selector -->
<pagebreak page-selector="rotated"/>
<p>This is on a landscape page</p>
<!-- Page Break with different page selector -->
<pagebreak page-selector="a5"/>
<p>This is on A5 paper</p>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment