A simple document with a page style
A simple pdf document that has a single block of inline text coloured red on the one and only page.
<pdf:Document xmlns:pdf="Scryber.Components, Scryber.Components, Version=0.8.0.0, Culture=neutral, PublicKeyToken=872cbeb81db952fe"
xmlns:styles="Scryber.Styles, Scryber.Styles, Version=0.8.0.0, Culture=neutral, PublicKeyToken=872cbeb81db952fe"
xmlns:data="Scryber.Data, Scryber.Components, Version=0.8.0.0, Culture=neutral, PublicKeyToken=872cbeb81db952fe">
<styles:Style applied-id="titlepage" >
<styles:Margins all="100pt" />
<styles:Page size="A4" orientation="Portrait"/>
<pdf:Page id="titlepage" >
<Content>Just some red text in the middle of the page</Content>
This is a very simple single page document. At the top level we declare the document itself, along
with the standard namespaces for components, styles and data
After the document we have a single style that will be applied to all components with an id of 'titlepage'
And within this style we have
- Margins. All margins are set to 100pt (1 point = 1/72 inch) and will be applied to all sides of the page.
- Fill. The fill colour can be described by a know colour name (e.g blue, black, red) or by its 6 character hexadecimal RGB value preceded by a hash (#)
- Position. There are a lot of options withing the position style, but here we are simply using the h-align option. The alignment will be attributed to the position of child components relative to the parent
- Page. Finally we explicitly set the size (ISO standard) and orientation of the page. Width and Height values could alternatively be specified for absolute dimensions.
After the style is complete, we add the main content, which in this case is a single page (with the style matching id of 'titlepage'), and add the content text inline.
This content will automatically pick up the fill colour and be aligned with respect to it's container.