All the visible content in a pdf document sit on pages.
All the visble components in a pdfx file sit in Pages or Sections.
By default a page is just that, a single page of content that will be generated in the PDF output. A Section can by default extend beyond a single page and content will continue to flow onto more and more generated PDF Pages.
Explicit page breaks can be put in to the content to force a section to go on to the next page.
<pdf:Page id="FirstPage" >
<Content>My First Page</Content>
<pdf:Section id="FirstSection" >
The first page of the section
The second page of the content
<pdf:Page-Ref id="FirstPage” source="./Pages/TermsAndConditions.ppfx" >
The Page definition contains the standard component attributes for id, name, visible, outline-title, along with the
styles attribute. All these attributes are optional and are covered in the Component Basics and Understanding Styles articles. These articles also cover the Style and Outline child elements.
Finally the 3 main child elements are the Header, Content and Footer. Each can contain a collection of components including panels, text blocks, links etc.
For example the page below can be generated....
<pdf:Page id="FirstPage" name="UniqueName"
styles:class="page single-page" >
<Outline title="Overides the Outline on the element" styles:open="true" />
This is some content at the head of the page
This is some content in the middle of the page
This is some content at the bottom of the page
And will result in the output shown.
The Header and Footer containers are different to the Content container in one significant feature.
They are template containers rather than actual component containers. This means that the compontents declared do not actually exist in memory until the page is laid out as part of the output process. There is a very good reason for this which will be explained when we go on to discuss Sections.
A section by default allows content to flow onto one or more generated PDF pages in the final document.
In the code the class Scryber.Components.PDFSection inherits from the class Scryber.Components.PDFPage. This means that a section acts almost exactly the same as a page. The PDFSection has a default value for overflow action of NewPage, which will allow content to flow onto any number of following output pages, and also 2 optional extra properties - ContinuationHeader and ContinuationFooter. If either is defined it will replace any existing header or footer template when the second page is laid out, or any further pages
The inheritance also means that any styles applied to the page type will also be applied to the section, but new styles applied to a section will not be applied to a page.
<pdf:Section styles:class="page document">
This is the Header
This is the Continuation Header
This is the footer
This is the Continuation Footer
If the section is generated for the declaration above, then we will get the following output
As we can see. The continuation headers are generated for both the second and third pages.
If the section did not have a continuation footer declared then the standard footer would have been generated for all pages
This is also why the Header and Footer are templates rather than actual instances - because they can appear more than once, so must be templates that are generated each time for all the pages they appear on.
Page header and footer margins