Spread Page Master Extension no-LT

AH Formatter V7.1 is able to treat two facing pages (a two-page spread) as a single unit, and you can define spread regions that span across the two pages. You can also define a single background for the two pages.

The requirement for formatting facing pages as a two-page spread appears in:

Only some documents need spreads, but uses for spreads include:

  • Titles that extend across two pages
  • Graphics or tables that are wider than one page
  • Full-bleed background images that extend across two pages

The Spread Page Master Extension adds the following two Formatting Objects:

FODefinition
<axf:spread-page-master>Defines the spread.
<axf:spread-region>Region that can span two pages.

Two-page spreads are typically exceptions to normal formatting, so <axf:spread-page-master> refers to other page masters for the definitions of the two pages' sizes and non-spread regions. When an <axf:spread-region> intersects an <fo:region-body> from one of the page masters, the <fo:region-body> is resized to be a smaller, rectangular region. When an <axf:spread-region> covers an <fo:region-body> from one of the page masters, the <fo:region-body> is dropped from the spread.

Extended Elements

<axf:spread-page-master> no-LT

Common Usage:

Specifies a two-page spread.

<axf:spread-page-master> is used in page master selection in the same way as <fo:simple-page-master>, but it always causes a multiple of two pages to be generated. You must ensure that the pairs of pages occur as two-page spreads. Properties that can help enforce this are maximum-repeats, initial-page-number, and force-page-count.

If the <axf:spread-region> children generate all regions on the pages (for example, the spread pages are a multi-page, double-wide table) but you do not know how many pairs of pages the spread content will use generate, then either the <axf:spread-page-master> should be the last page master in the <fo:page-sequence-master> or the content of the spread pages should be in a nested <fo:page-sequence> that uses only the <axf:spread-page-master>.

Areas:

Generates no area directly. It is used in the generation of pages by an <fo:page-sequence>.

Constraints:
<!ELEMENT axf:spread-page-master (axf:spread-region*)>
<!ATTLIST axf:spread-page-master master-name                        CDATA #REQUIRED>
<!ATTLIST axf:spread-page-master axf:left-page-master-reference     CDATA #REQUIRED>
<!ATTLIST axf:spread-page-master axf:right-page-master-reference    CDATA #REQUIRED>
<!ATTLIST axf:spread-page-master reference-orientation              CDATA "0">
<!ATTLIST axf:spread-page-master writing-mode                       CDATA "lr-tb">
<!ATTLIST axf:spread-page-master %common-margin-properties-block;>

<axf:spread-region> no-LT

Common Usage:

Specifies a region in a two-page spread.

Areas:

Used to generate one region-viewport-area and one region-reference-area whenever its parent <axf:spread-page-master> is used to generate a page.

Constraints:
<!ELEMENT axf:spread-region EMPTY>
<!ATTLIST axf:spread-region region-name                            CDATA #REQUIRED>
<!ATTLIST axf:spread-region height                                 CDATA "auto">
<!ATTLIST axf:spread-region overflow                               CDATA "auto">
<!ATTLIST axf:spread-region reference-orientation                  CDATA "0">
<!ATTLIST axf:spread-region width                                  CDATA "auto">
<!ATTLIST axf:spread-region writing-mode                           CDATA "lr-tb">
<!ATTLIST axf:spread-region %common-absolute-position-properties;>
<!ATTLIST axf:spread-region %common-border-padding-and-background-properties;>
<!ATTLIST axf:spread-region %common-margin-properties-block;>

Extended Properties

axf:left-page-master-reference no-LT

Master name of the page master for the left page of a two-page spread.

Value:<name>
Initial:N/A, a value is required
Applies to:axf:spread-page-master
Inherited:no
Percentages:N/A

Values have the following meanings:

<name>

The name must refer to a master-name that exists within the document.

axf:left-page-master-reference refers to the page master that defines the page size and the non-spread regions for the left-hand page of a two-page spread.

axf:right-page-master-reference no-LT

Master name of the page master for the right page of a two-page spread.

Value:<name>
Initial:N/A, a value is required
Applies to:axf:spread-page-master
Inherited:no
Percentages:N/A

Values have the following meanings:

<name>

The name must refer to a master-name that exists within the document.

axf:right-page-master-reference refers to the page master that defines the page size and the non-spread regions for the right-hand page of a two-page spread.

Example

The following example shows two pages generated using an <axf:spread-page-master>. The definitions of the page sizes and non-spread regions are from the “left” and “right” <fo:simple-page-master> that are referred to from the “spreadpm” <axf:spread-page-master>. The <axf:spread-page-master> defines a “top” <axf:spread-region> that spans across the two pages of the spread. In this example, the “top” region contains a title. The content of the “xsl-region-body” flow generates areas in the body regions defined by the <fo:region-body> in the two <fo:page-sequence-master>.

<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions">
 <fo:layout-master-set>
  <fo:simple-page-master master-name="left" page-width="70mm" page-height="100mm">
   <fo:region-body margin="36pt" margin-right="48pt" background-color="#E1E8E2" padding="6pt"/>
   <fo:region-before region-name="left-header" extent="36pt" padding-start="36pt" display-align="center"/>
   <fo:region-after extent="36pt" padding-start="36pt" display-align="center"/>
  </fo:simple-page-master>
  <fo:simple-page-master master-name="right" page-width="70mm" page-height="100mm">
   <fo:region-body margin="36pt" margin-left="48pt" background-color="#E1E8E2" padding="6pt"/>
   <fo:region-before region-name="right-header" extent="36pt" padding-end="36pt" display-align="center"/>
   <fo:region-after extent="36pt" padding-end="36pt" display-align="center"/>
  </fo:simple-page-master>
  <axf:spread-page-master master-name="spreadpm" left-page-master-reference="left" right-page-master-reference="right">
   <axf:spread-region region-name="top" margin="36pt" margin-bottom="72mm"/>
  </axf:spread-page-master>
  <fo:page-sequence-master master-name="psm">
   <fo:repeatable-page-master-reference master-reference="spreadpm"/>
   <fo:repeatable-page-master-alternatives>
    <fo:conditional-page-master-reference master-reference="left" odd-or-even="even"/>
    <fo:conditional-page-master-reference master-reference="right" odd-or-even="odd"/>
   </fo:repeatable-page-master-alternatives>
  </fo:page-sequence-master>
 </fo:layout-master-set>
 <fo:page-sequence master-reference="psm" initial-page-number="2" force-page-count="end-on-odd">
  <fo:static-content flow-name="left-header">
   <fo:block text-align="outside" margin="0">left</fo:block>
  </fo:static-content>
  <fo:static-content flow-name="right-header">
   <fo:block text-align="outside" margin="0">right</fo:block>
  </fo:static-content>
  <fo:static-content flow-name="xsl-region-after">
   <fo:block text-align="outside" margin="0"><fo:page-number /></fo:block>
  </fo:static-content>
  <fo:flow flow-name="top">
   <fo:block-container height="100%" color="#003D19" font-size="100pt" overflow="condense" axf:overflow-condense="font-size" font-weight="bold">
    <fo:block>axf:spread-page-master</fo:block>
   </fo:block-container>
  </fo:flow>
  <fo:flow flow-name="xsl-region-body">
   <fo:block>
    <fo:inline font-weight="bold">AH Formatter</fo:inline> is able to treat two facing pages (a two-page spread) as a single unit, and you can define spread regions that span across the two pages. You can also define a single background for the two pages.
   </fo:block>
   <fo:block text-indent="1em">
    Only some documents need spreads, but uses for spreads include: titles that extend across two pages; graphics or tables that are wider than one page; full-bleed background images that extend across two pages.
   </fo:block>
  </fo:flow>
 </fo:page-sequence>
</fo:root>