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

Column Layout

Not Rated Yet

A common structural element of a document page is a column. These aid readability and separation. scryber supports columns on pages and all block level components.

 

Article contents

 

A lengthy document

 

When a page contains a large quantity of text, it is often quite difficult to read across the page as the eye finds it difficult to follow long lines of text, especially if the leading (spacing) is shallow.

 

<pdf:Document xmlns:pdf="Scryber.Components, Scryber.Components, Version=0.8.0.0, Culture=neutral, PublicKeyToken=872cbeb81db952fe"
              xmlns:style="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"
              id="PostioningAndFlow" compression="Compress" auto-bind="true">
  <Viewer page-display="Outlines" page-layout="SinglePage"/>
  <Styles>
    <style:Style applied-type="pdf:Section" >
      <style:Font size="12pt" />
    </style:Style>
  </Styles>
  <Pages>

    <pdf:Section style:border-color="red"
              style:margins="20" style:padding="10" >
      <Content>
		<pdf:H1>A long text document</pdf:H1>
        <pdf:Para>
          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin sed auctor est. In rutrum eleifend arcu,
          suscipit sollicitudin arcu commodo quis. Vivamus pulvinar finibus felis et congue. Vivamus semper ante
          nec ipsum sollicitudin ornare. Nunc purus metus, ornare ut malesuada nec, dapibus vitae massa. Pellentesque
          sodales gravida nunc. Sed rutrum dui sed felis eleifend fringilla. Cras porttitor leo sollicitudin nibh
          suscipit malesuada. Phasellus non augue massa. Cras eu finibus tellus. Vivamus sapien ligula, pellentesque
          ut elit eget, facilisis auctor leo. Nunc sed ex sodales, scelerisque ligula ac, laoreet risus.
          Aliquam sed iaculis urna.
        </pdf:Para>
        <pdf:Para>
          Sed at malesuada augue, vitae hendrerit nisl. Pellentesque hendrerit eleifend dictum. Sed at mollis tellus, 
          elementum dignissim mi. Nulla cursus libero ac tellus lacinia, eget pharetra odio viverra. Aenean placerat 
          .
          .
          .
          .
          Proin sit amet nunc sem. Vivamus at molestie metus, nec condimentum mauris.
        </pdf:Para>
        <pdf:Para>
          Fusce porta lectus ut aliquet auctor. Duis gravida ornare ullamcorper. Morbi nisl massa, lacinia id dolor a, 
          euismod blandit nibh. Morbi mattis quam eros, nec tincidunt justo iaculis ac. Nunc fringilla mollis enim,
          eu consequat justo lacinia nec. Aenean porta suscipit sem, vel consectetur massa porta fringilla. Ut lobortis,
          ligula at ultrices vestibulum, risus sapien auctor ex, nec imperdiet diam est non eros. In vel scelerisque 
          libero. Duis fringilla sed mi a vehicula. Cras eu dapibus ante, eu imperdiet quam. Duis eu purus 
          ac massa tempor mattis.
        </pdf:Para>
      </Content>
    </pdf:Section>

  </Pages>
</pdf:Document>

 

 

Splitting into Columns

 

In order to make this more readable we can easily split this into 2 columns with the text (and other content) flowing down one column, and then moving onto the next. When the content flows onto the next page, then it will start again on the first column.

The number of columns is unlimited (2^32) so if 3, 4 or more columns are needed, scryber will accommodate them as best as possible.

 

<pdf:Document xmlns:pdf="Scryber.Components, Scryber.Components, Version=0.8.0.0, Culture=neutral, PublicKeyToken=872cbeb81db952fe"
	          xmlns:style="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"
	          id="PostioningAndFlow" compression="Compress" auto-bind="true">
  <Viewer page-display="Outlines" page-layout="SinglePage"/>
  <Styles>
    <style:Style applied-type="pdf:Section" >
      <style:Font size="12pt" />
    </style:Style>

    <style:Style applied-class="columns" >
      <style:Columns count="2"/>
    </style:Style>

  </Styles>
  <Pages>

    <pdf:Section style:class="columns" style:border-color="red"
              style:margins="20" style:padding="10" >
      <Content>
        <pdf:H1>A long text document</pdf:H1>
        <pdf:Para>
          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin sed auctor est. In rutrum eleifend arcu,
          suscipit sollicitudin arcu commodo quis. Vivamus pulvinar finibus felis et congue. Vivamus semper ante
          nec ipsum sollicitudin ornare. Nunc purus metus, ornare ut malesuada nec, dapibus vitae massa. Pellentesque
          sodales gravida nunc. Sed rutrum dui sed felis eleifend fringilla. Cras porttitor leo sollicitudin nibh
          suscipit malesuada. Phasellus non augue massa. Cras eu finibus tellus. Vivamus sapien ligula, pellentesque
          ut elit eget, facilisis auctor leo. Nunc sed ex sodales, scelerisque ligula ac, laoreet risus.
          Aliquam sed iaculis urna.
        </pdf:Para>
        <pdf:Para>
          Sed at malesuada augue, vitae hendrerit nisl. Pellentesque hendrerit eleifend dictum. Sed at mollis tellus, 
          elementum dignissim mi. Nulla cursus libero ac tellus lacinia, eget pharetra odio viverra. Aenean placerat 
          .
          .
          .
          .
          Proin sit amet nunc sem. Vivamus at molestie metus, nec condimentum mauris.
        </pdf:Para>
        <pdf:Para>
          Fusce porta lectus ut aliquet auctor. Duis gravida ornare ullamcorper. Morbi nisl massa, lacinia id dolor a, 
          euismod blandit nibh. Morbi mattis quam eros, nec tincidunt justo iaculis ac. Nunc fringilla mollis enim,
          eu consequat justo lacinia nec. Aenean porta suscipit sem, vel consectetur massa porta fringilla. Ut lobortis,
          ligula at ultrices vestibulum, risus sapien auctor ex, nec imperdiet diam est non eros. In vel scelerisque 
          libero. Duis fringilla sed mi a vehicula. Cras eu dapibus ante, eu imperdiet quam. Duis eu purus 
          ac massa tempor mattis.
        </pdf:Para>
      </Content>
    </pdf:Section>

  </Pages>
</pdf:Document>

 

 

Unfortunately what has happened is the title is now also broken across the columns which, although understandable, does not make for a good layout.

The best way around this is to remove the columns from the pdf:Section globally, and apply to an inner block component to overflow onto the next page

<pdf:Document xmlns:pdf="Scryber.Components, Scryber.Components, Version=0.8.0.0, Culture=neutral, PublicKeyToken=872cbeb81db952fe"
              xmlns:style="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"
              id="PostioningAndFlow" compression="Compress" auto-bind="true">
  <Viewer page-display="Outlines" page-layout="SinglePage"/>
  <Styles>
    <style:Style applied-type="pdf:Section" >
      <style:Font size="12pt" />
    </style:Style>

    <style:Style applied-class="columns" >
      <style:Columns count="2"/>
    </style:Style>

  </Styles>
  <Pages>

    <pdf:Section style:border-color="red"
              style:margins="20" style:padding="10" >
      <Content>
        <pdf:H1>A long text document</pdf:H1>
        <pdf:Div style:class="columns" >
        	<pdf:Para>
	          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin sed auctor est. In rutrum eleifend arcu,
	          suscipit sollicitudin arcu commodo quis. Vivamus pulvinar finibus felis et congue. Vivamus semper ante
	          nec ipsum sollicitudin ornare. Nunc purus metus, ornare ut malesuada nec, dapibus vitae massa. Pellentesque
	          sodales gravida nunc. Sed rutrum dui sed felis eleifend fringilla. Cras porttitor leo sollicitudin nibh
	          suscipit malesuada. Phasellus non augue massa. Cras eu finibus tellus. Vivamus sapien ligula, pellentesque
	          ut elit eget, facilisis auctor leo. Nunc sed ex sodales, scelerisque ligula ac, laoreet risus.
	          Aliquam sed iaculis urna.
	        </pdf:Para>
	        <pdf:Para>
	          Sed at malesuada augue, vitae hendrerit nisl. Pellentesque hendrerit eleifend dictum. Sed at mollis tellus, 
	          elementum dignissim mi. Nulla cursus libero ac tellus lacinia, eget pharetra odio viverra. Aenean placerat 
	          .
	          .
	          .
	          .
	          Proin sit amet nunc sem. Vivamus at molestie metus, nec condimentum mauris.
	        </pdf:Para>
	        <pdf:Para>
	          Fusce porta lectus ut aliquet auctor. Duis gravida ornare ullamcorper. Morbi nisl massa, lacinia id dolor a, 
	          euismod blandit nibh. Morbi mattis quam eros, nec tincidunt justo iaculis ac. Nunc fringilla mollis enim,
	          eu consequat justo lacinia nec. Aenean porta suscipit sem, vel consectetur massa porta fringilla. Ut lobortis,
	          ligula at ultrices vestibulum, risus sapien auctor ex, nec imperdiet diam est non eros. In vel scelerisque 
	          libero. Duis fringilla sed mi a vehicula. Cras eu dapibus ante, eu imperdiet quam. Duis eu purus 
	          ac massa tempor mattis.
	        </pdf:Para>
        </pdf:Div>
      </Content>
    </pdf:Section>

  </Pages>
</pdf:Document>

 

 

Adding column breaks

 

By default content will simply flow along the columns as far as it is able, and then move to the next available column (or onto the next page).

However it is possible to explicitly break a column and move to the next using the pdf:ColumnBreak component.

This is currently driven from the component itself, rather than any style option. This will probably change in a future release

 

<pdf:Document xmlns:pdf="Scryber.Components, Scryber.Components, Version=0.8.0.0, Culture=neutral, PublicKeyToken=872cbeb81db952fe"
              xmlns:style="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"
              id="PostioningAndFlow" compression="Compress" auto-bind="true">
  <Viewer page-display="Outlines" page-layout="SinglePage"/>
  <Styles>
    <style:Style applied-type="pdf:Section" >
      <style:Font size="12pt" />
    </style:Style>

    <style:Style applied-class="columns" >
      <style:Columns count="2"/>
    </style:Style>

  </Styles>
  <Pages>

    <pdf:Section style:border-color="red"
              style:margins="20" style:padding="10" >
      <Content>
        <pdf:H1>A long text document</pdf:H1>
        <pdf:Div style:class="columns" >
        <pdf:Para>
          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin sed auctor est. In rutrum eleifend arcu,
          suscipit sollicitudin arcu commodo quis. Vivamus pulvinar finibus felis et congue. Vivamus semper ante
          nec ipsum sollicitudin ornare. Nunc purus metus, ornare ut malesuada nec, dapibus vitae massa. Pellentesque
          sodales gravida nunc. Sed rutrum dui sed felis eleifend fringilla. Cras porttitor leo sollicitudin nibh
          suscipit malesuada. Phasellus non augue massa. Cras eu finibus tellus. Vivamus sapien ligula, pellentesque
          ut elit eget, facilisis auctor leo. Nunc sed ex sodales, scelerisque ligula ac, laoreet risus.
          Aliquam sed iaculis urna.
        </pdf:Para>
        <pdf:ColumnBreak/>
        <pdf:Para>
          Sed at malesuada augue, vitae hendrerit nisl. Pellentesque hendrerit eleifend dictum. Sed at mollis tellus, 
          elementum dignissim mi. Nulla cursus libero ac tellus lacinia, eget pharetra odio viverra. Aenean placerat 
          .
          .
          <pdf:ColumnBreak/>
          .
          .
          Proin sit amet nunc sem. Vivamus at molestie metus, nec condimentum mauris.
        </pdf:Para>
        <pdf:Para>
          Fusce porta lectus ut aliquet auctor. Duis gravida ornare ullamcorper. Morbi nisl massa, lacinia id dolor a, 
          euismod blandit nibh. Morbi mattis quam eros, nec tincidunt justo iaculis ac. Nunc fringilla mollis enim,
          eu consequat justo lacinia nec. Aenean porta suscipit sem, vel consectetur massa porta fringilla. Ut lobortis,
          ligula at ultrices vestibulum, risus sapien auctor ex, nec imperdiet diam est non eros. In vel scelerisque 
          libero. Duis fringilla sed mi a vehicula. Cras eu dapibus ante, eu imperdiet quam. Duis eu purus 
          ac massa tempor mattis.
        </pdf:Para>
        </pdf:Div>
      </Content>
    </pdf:Section>

  </Pages>
</pdf:Document>

 

 

Column breaks can be placed anywhere in the template, and they will always travel up the hierarchy to the first component that has another column to break into. So columns can be nested to any desired depth. If there is no multicolumn component within the hierarchy, then a new page will be added where possible. If the current page does not allow overflow, then the layout will not continue on after this.

 

Alley widths

 

By default the alley (space) between 2 columns is 10pt, but again this can be adjusted with the 'alley-width' attribute to any required value.

    <style:Style applied-class="columns" >
      <style:Columns count="2" alley-width="60pt" />
    </style:Style>

 

 

Column widths and alignment

 

It is currently not supported to explicitly specify dynamic widths on columns of a block, they will always be of equal width and have the same alley. The columns are also always aligned the same (horizontally and vertically) and cannot be automatically balanced.

 



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