Background Color:
 
Background Pattern:
Reset
Search
Home Recent Changes Show All Pages

Simple Document

Not Rated Yet

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>
    
    <styles:Style applied-id="titlepage" >
      <styles:Margins all="100pt" />
      <styles:Fill color="#FF0000"/>
      <styles:Position h-align="Center"/>
      <styles:Page size="A4" orientation="Portrait"/>
    </styles:Style>

  </Styles>
  <Pages>

    <pdf:Page id="titlepage" >
      <Content>Just some red text in the middle of the page</Content>
    </pdf:Page>

  </Pages>
</pdf:Document>
Generate and download PDF Download XMLDownload Source XML

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.



  Rating
Rate This Page: Poor Great   |  Rate Content |
Average rating:  No Ratings Yet   
Number of Ratings : 0
  Comments
Add Comment
No Comments Yet