web analytics

Defining Page Layout in XSLT-FO

Options

codeling 1602 - 6666
@2017-09-26 10:16:03

You use masters to create templates for pages, page sequences, and regions. The <fo:layout-master-set> element contains all the masters used in the document, including page sequence masters, page masters, and region masters, which you apply to create page sequences, pages, and regions.

@2017-09-26 10:18:13

fo:layout-master-set

The fo:layout-master-set is a wrapper around all masters used in the document. This includes page-sequence-masters, page-masters, and region-masters.

Areas:

The fo:layout-master-set formatting object generates no area directly. The masters that are the children of the fo:layout-master-set are used by the fo:page-sequence to generate pages.

Constraints:

The value of the master-name trait on each child of the fo:layout-master-set must be unique within the set.

@2017-09-26 10:30:25

fo:simple-page-master

The fo:simple-page-master is used in the generation of pages and specifies the geometry of the page. The page may be subdivided into up to five regions: region-body, region-before, region-after, region-start, and region-end.

  • region-body — the main area of the page in which document contents are placed;
  • region-before — page header;
  • region-after — page footer;
  • region-start — the left margin (for the direction of the text from left to right);
  • region-end — the right margin (for the direction of the text from left to right).

Each area has name. By default it corresponds to the name of element. The name can be set in the region-name parameter. The name of area is used that when forming the document to specify, in what area what this to display. For example, static data of fo:static-content are most often output in headlines or to fields.
The publication DITA in PDF with use of DITA Open Toolkit. Marking of pages — the layout-master overview

Sizes of areas

Each of areas (except region-body) has the extent parameter determining the area size in the direction perpendicular to the relevant party of the page. For headlines — it is height, for fields — width. It is set in terms of length, or percentage of the corresponding page size (page-height and page-width parameters).

Region-body area

The sizes of the region-body area are defined otherwise. First, they are limited to the sizes of page fields. Secondly, it has 4 parameters: margin-top, margin-bottom, margin-left and margin-right which define region-body area border indents from the content rectangle of the page reference area area designated by stroke in the second drawing. These indents can be set in terms of length or percentage of the size of the content rectangle of the page reference area area.
Here it is necessary to draw rather significant conclusion that borders of the region-body area do not depend on the sizes and parameters of the next areas.

Indents of the region-body area are located according to orientation of the page. For example, if for the page orientation 90 is set, the upper indent is counted from this direction. If for region-body the orientation (reference-orientation parameter) is set, it does not influence arrangement of indents in any way. All of them are equally counted according to orientation of the page. Orientation of the region-body area influences only how child blocks will be located in it.

For the region-body area the quantity of columns in which document contents will be placed can be set. Two parameters are responsible for it: column-count — sets quantity of columns (has to be more or equally 1); column-gap — distance between the next columns.

Alignment in areas

The display-align parameter which can accept values is intended for alignment in areas: auto, before, center, after. It defines alignment of child blocks in area in the direction of their following which is specified in the writing-mode parameter.

And what with corners?

Two upper corners of the page can be occupied with either page header or left and right fields. Similarly, the lower cornerspage footer or left and right fields. The precedence parameter specified for headlines is responsible for it. If parameter matters true, corners are occupied by headline (for what parameter is specified). If parameter matters false, corners occupy fields. By default parameter matters false.

 

The fo:simple-page-master element has the following parameters:

  • master-name — unique identifier of marking.
  • page-height — page height.
  • page-width — page width.
  • margin-top, margin-bottom, margin-left and margin-right — the sizes of page fields. It is necessary to distinguish them from the headlines and fields which are work areas.
  • reference-orientation — orientation of top of the page (corner in degrees counterclockwise) concerning value by default. Can accept values:-270,-180,-90, 0, 90, 180, 270. By default — 0.
  • writing-mode — the mode defining arrangement of areas and blocks (paragraphs, tables, illustrations, etc.) on the page. There are three modes: lr-tb (from left to right, from top to down), rl-tb (from right to left, from top to down), tb-rl (from top to down, from right to left). The first part of the name of the mode specifies the direction of the text in lines, the second — the direction of following of blocks within area.
@2017-09-26 10:45:37

fo:page-sequence-master

The fo:page-sequence-master is used to specify the constraints on and the order in which a given set of page-masters will be used in generating a sequence of pages. Pages are automatically generated when the fo:page-sequence-master is used in formatting an fo:page-sequence.

This element has three child entries:

  • fo:single-page-master-reference — is used when it is required to create sequence from one page. For example, cover page of the document. During the work with the fo:single-page-master-reference element it is necessary to remember that if one page is not enough for placement of initial content, it will cause error at the publication.
  • fo:repeatable-page-master-reference — is used for forming of limited or unlimited sequences of pages with identical marking. When using the fo:repeatable-page-master-reference element the limit number of pages which will be created can be specified. For this purpose the maximum-repeats parameter serves. By default the number of pages is not limited.
  • fo:repeatable-page-master-alternatives — is used for forming of several sequences with different marking depending on the specified parameters. Is the most flexible tool.

Marking choice conditions in the fo:repeatable-page-master-alternatives element are set by means of child entries of fo:conditional-page-master-reference. Each condition may contain from one to three parameters in total defining the condition is satisfied or not. For fo:repeatable-page-master-alternatives the limit number of pages in the maximum-repeats parameter can be also set.

These are the following parameters:

  • page-position — page arrangement in the section — first (first), last (last), rest (not the first and not the last), any (any).
  • odd-or-even — parity of number of the page — odd (odd), even (even), any (any).
  • blank-or-not-blank — whether the page has the data transferred from the fo:flow — blank block (empty) not-blank (not empty), any (any).

Comments

You must Sign In to comment on this topic.


© 2024 Digcode.com