Pages

A template is used to define page characteristics. The dimensions of the page itself, and the margins that surround the area of the page that can be written to, are both specified using attributes on the Simple Page Master element.

Height and width

The height and width of the page is specified using the Page Height and Page Width attributes (an A4 page has a height of 29.7cm and a width of 21.0cm):

<simple-page-master master-name="Prelims"
                    page-height="29.7cm"
                    page-width="21.0cm">
  ...
</simple-page-master>

The value 'auto' is used when the page size is not known by the formatter. The value 'indefinite' specifies that the size of the page should be driven by the content. This is appropriate for the height dimension when the information is presented as an electronic page in a browser window.

Note that when creating a stylesheet for presentation of material in an electronic product that creates a simple, scrollable interface (such as a Web browser), this can be considered to be a single (possibly very long) page and the following discussion on page sequences is not relevant. In this very simple case, a single page master template is created, and is referenced from a single page sequence object.

The height and width can also be specified using a single Size attribute, though the draft standard is still unclear on which direction is specified first.

Orientation

Most printers are able to print to a page in 'portrait' or 'landscape' orientation. In XSL, the Reference Orientation attribute can be used to specify what is to be considered the top and bottom of the page, irrespective of how the page is fed into the printer. Degree angles are entered in this attribute:

<simple-page-master reference-orientation="90" ... >

Writing direction

Text can be written left-to-right and top-to-bottom (as in English documents), or in any other combination, such as right-to-left and bottom-to-top. The possible values of the Writing Mode attribute are abbreviations of these settings, using 'l' for 'left', 'r' for 'right', 't' for 'top' and 'b' for 'bottom', so 'lr-tb' is appropriate for an English book:

<simple-page-master writing-mode="lr-tb" ... >

Note that the 'top' of a page is the side of the page defined to be at the top according to the page orientation described above. When the value is 'lr-tb', writing follows the paths shown below:

In English, when discussing objects that need to appear above a block of text, the term 'above' can be safely used. Likewise, when discussing objects that need to appear to the left of a line of text, the term 'left of' is unambiguous. But when lines can be written in either direction, and from bottom-to-top, these terms will often be inaccurate. Instead, the terms 'before' and 'after' are used to indicate position relative to blocks of text ('above' and 'below' in English), and 'start' and 'end' are used to indicate position relative to in-line objects.

These terms are used frequently in the XSL standard. They are often part of an element or attribute name that is targetted at one of these positions (such as the attribute named 'border-start-style' and the element named 'region-after').

Margins

Most printing devices are unable to print text right up to the edge of a page, and even when this is possible it is usually undesirable. The area between the edge of the printable region and the edge of the paper is known as the 'margin', and margins for each edge are defined using the Margin Top, Margin Right, Margin Bottom and Margin Left attributes.

Each of these attributes takes a value that specifies the distance between the edge of the paper and the edge of the printable area. When printing double-sided for binding into a document or book, the left-side and right-side pages often have different margin widths (to cater for the space lost in the centre of the book due to the binding):

<simple-page-master master-name="left-page"
                    margin-left="1cm"
                    margin-right="1.5cm"
                    margin-top="1.5cm"
                    margin-bottom="2cm" >

Again, the definiton of 'top' is taken from the page orientation:

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset