This is the documentation for an older version of Scroll PDF Exporter. Here you can view the most up-to-date version of the Scroll PDF Exporter documentation.

Enforcing Pagebreaks

In order to control pagebreaks, it is possible to let Scroll PDF Exporter enter pagebreaks at certain landmarks. You can also add pagebreaks in your Confluence pages. For more information, see Adding page breaks. 

In the default template, pagebreaks are inserted before every heading 1 (in the CSS described as "section-1"):

Default Pagebreak Definitions
div.section-1 {
page-break-before: always;
}

Before you begin: To enforce pagebreaks, a template must exist.

To enforce pagebreaks:

  1. Open your template and click Content Formatting.
  2. You can now edit the pagebreaks:
    •  To add a pagebreak before each heading 2, enter the following lines of code:
      Example: Pagebreaks Before level-2 headings
      div.section-1,
      div.section-2 {
      page-break-before: always;
      }
      
    •  To disable enforced pagebreaks before heading 1, enter the following lines of code:
      Example: Avoid Page Breaks
      div.section-1 {
      page-break-before: auto;
      } 
    •  To avoid pagebreaks inside a paragraph, enter the following lines of code (this example refers to the paragraph 'nobreak'):
      Example: Avoid Page Breaks inside a Paragraph
      p.nobreak {
      page-break-inside: avoid;
      }
    •  To suppress page breaks before heading 1 but keep them after the title page and TOC page, add the following lines of code:
      Example: Suppress page breaks before h1 but keep them after the Titlepage and TOC page
      div.section-1 {
        page-break-before: auto;
      }
      
      div.toc, div.content {
        page-break-before: always;
      }

      (info) Please note that 'toc' and 'content' are the CSS classes as defined in the static pages section in the template designer.

    •  To enforce a page break in the TOC after every heading 1, enter the following lines of code:
      Enforce Pagebreak in the TOC after every h1 Heading
      ul.toc li {
        page-break-inside: avoid;
      }
    •  To enforce a page break for every new Confluence page enter the following lines of code:
      Example: Page Breaks on new Confluence Pages
      div.section.new-page-section {
        page-break-before: always;
      } 
    •  To avoid a page break between figures and captions enter the following lines of code:
      Example: Avoid Page Breaks between figures and captions
      .scroll-figure {
        page-break-inside: avoid;
      }           
  3. Click Save.

The pagebreaks are inserted in the wanted positions.

For more information see Page breaks in the W3C website.