12.6.4 Page-sequence Flow Object Class
A page-sequence flow object is formatted to produce a sequence of page areas.  The structure and positioning of the page areas shall be controlled by page-models.
A page-sequence flow object has the following characteristics:

•  initial-page-models: is a list of page-models used for the initial pages. The initial value is the empty list.

•  repeat-page-models: is a list of page-models used for pages after the initial pages. The initial value is the empty list.

•  force-last-page: is either #f or one of the symbols front or back specifying the required type of the last page of the page-sequence.  If the last page is not of the required type, then an additional blank page shall be generated.  A value of #f indicates that the last page may be of either type. The initial value is #f.

•  force-first-page: is either #f or one of the symbols front or back specifying the required type of the first page of the page-sequence.  If the value is not #f, then the parent flow object shall be of type root; if there is a preceding flow object, then it shall be of type page-sequence.  If the value of the force-last-page: characteristic of the preceding page-sequence is not #f, it shall have the opposite type to the specified value of the characteristic.  If the last page of the preceding page-sequence is not of the opposite type to the value specified for this characteristic, then the preceding page-sequence shall have an additional blank page added.  If there is no preceding flow object and the value is not #f, then it shall be an error if the specified type of the first page is not the actual type as determined by the first-page-type: characteristic. The initial value is #f.

•  first-page-type: is either one of the symbols front or back indicating that the first page of the page-sequence is a front or back page, or the symbol parent indicating that the type of the first page shall be determined by the parent flow object. The initial value is parent.  A value of parent shall be allowed only if the parent flow object is the root flow object.  In this case, if there is a preceding flow object, then it shall be of type page-sequence, and the first page shall be a front or back page if the last page of the preceding page-sequence was a back or front page; if there is no preceding flow object, then the first page shall be a front page.  This characteristic does not cause additional pages to be generated; it merely states that this page will be of the specified type when it is printed and bound.  The value shall be parent unless the value of the force-first-page: characteristic is #f.

NOTE 62

This information makes it possible to determine which pairs of pages are spreads.

•  blank-back-page-model: is a page-model that shall be used for the final page if it was a back page and was required only because of the force-last-page: or force-first-page: characteristics, or it is #f if the normal page-model should be used for the final page.  The initial value is #f.

•  blank-front-page-model: is a page-model that shall be used for the final page if it was a front page and was required only because of the force-last-page: or force-first-page: characteristics, or it is #f if the normal page-model should be used for the final page.  The initial value is #f.

•  justify-spread?: is a boolean specifying whether the bottom of each page in a spread shall be justified.   The initial value is #f.

•  page-category: specifies the category of the page areas resulting from this page-sequence flow object. It may be any expression language object for which the equal? procedure is defined. The category of an area is used by procedures defined in section 12.5.1.2, Layout Numbering.

•  binding-edge: is one of the symbols left, right, top, or bottom specifying the edge of a front page to be bound.  This affects whether a side of the page is considered to be on the inside or outside.  The initial value is left.
There shall be an applicable page-model for every page produced by the page-sequence.
The ports of a page-sequence flow object are determined by the page-models.
12.6.4.1 Page-model
A page-model is the specification of a set of possible hierarchies of areas.
(page-model? obj)
Returns #t if obj is of type page-model, and otherwise returns #f.
[188] page-model-definition = (define-page-model page-model-name page-region-specification+ | width-specification | height-specification | filling-direction-specification? | decoration-specification*)
[189] page-model-name = variable
define-page-model binds page-model-name to a page-model object.
The top-level area is the page area.  The page area contains a number of sub-areas called page-regions.  The layout order of the page-regions corresponds to the order of their specification in the page-model-definition.  Page-regions may overlap.
[190] page-region-specification = (region x-origin-specification | y-origin-specification | width-specification | height-specification | decoration-specification* | filling-direction-specification? | header-specification? | footer-specification? | page-region-flow-map? )
A page-region-specification specifies an area container with fixed dimensions that is filled to produce a page-region area.  Each page-region has a single predominant filling-direction.

NOTE 63

Included-container-area flow objects may use a different filling direction.
It is possible to have display areas with different placement  directions on the same page using multiple page-regions, as illustrated in Figure 15, Multiple Filling Directions on a Single Page.
[191] page-region-flow-map = (flow port-specifier+)
A page-region-flow-map specifies that areas resulting from formatting flow objects directed into any of the ports identified by one of the port-specifiers may be assigned to this page-region.
If there is no page-region-flow-map, then (flow #f) is the default.
If a port-specifier occurs in more than one page-region-flow-map in a page-region-specification in a page-model-definition, then the page-regions shall be filled in the order in which their page-region-specifications occur in the page-model-definition.
[192] port-specifier = identifier | #f
A port-specifier that is an identifier specifies a port with that name; a port-specifier of #f specifies the principal port.
[193] header-specification = (header generated-area-clauses )
A header-specification specifies areas to be generated at the beginning of a page-region or column.
[194] footer-specification = (footer generated-area-clauses )
A header-specification specifies areas to be generated at the end of a page-region or column.
[195] generated-area-clauses = height-specification? | width-specification? | filling-direction-specification? | contents-alignment-specification? | generate-specification
generated-area-clauses specifies areas to be generated.
[196] generate-specification = (generate expression)
The expression shall evaluate to an unlabeled sosofo specifying only displayed flow objects.
[197] x-origin-specification = (x-origin expression)
The expression shall evaluate to a length which specifies the x component of the origin of the area container with respect to its parent's coordinate system.
[198] y-origin-specification = (y-origin expression)
The expression shall evaluate to a length which specifies the y component of the origin of the area container with respect to its parent's coordinate system.
[199] width-specification = (width expression)
The expression shall evaluate to a length which specifies the width (size in the positive x direction) of the area container with respect to its parent's coordinate system.
[200] height-specification = (height expression)
The expression shall evaluate to a length which specifies the height (size in the positive y-direction) of the area container with respect to its parent's coordinate system.
[201] decoration-specification = (decorate expression)
The expression shall evaluate to a decoration-area object.  The area is decorated by the object as explained in section 12.5.3, Decoration Areas.
[202] filling-direction-specification = (filling-direction expression )
The expression shall evaluate to one of the symbols left-to-right, right-to-left, or top-to-bottom specifying the filling-direction of the area container.
If the filling-direction is not specified on the page-region, it shall be inherited from the page-model.  It shall be an error if it is not specified on either the page-region or the page-model.
[203] contents-alignment-specification = (contents-alignment expression )
The expression shall evaluate to one of the symbols start, end, center, or justify specifying the alignment of the child areas within the area container in the filling-direction of the area container. The default is start.