Page control and binding

The <page-info/> command

This command can be used to retrieve information about the current page. The command format is:

<page-info var="NAME" type="INFO" />

where :

  • var is the name of a user variable that contains the requested value.

  • type specifies the type of information requested. The type of information is one of the following:

    • seqn — the output page sequence number. The first page produced by the composition engine is 1, the second is 2, and so on. This value is only valid when requested from within a Header/Footer content box.

      The following example shows how to use the page sequence number to render a first page header title and a separate title for all other pages:

      <page-info var="Seqn" type="seqn" />
      <switch>
      <case var="Seqn" target="1" >
      <ManufacturerHead>{Manufacturer}</ManufacturerHead>
      </case>
      <case>
      <MonthYearHead>{Month} {Year}</MonthYearHead>
      </case>
      </switch>
      
    • side — the output page side. The value returned for a right hand page is 2, and the value returned for a left hand page is 1. This value is only valid when requested from within a Header/Footer content box.

      The following example shows how to use the page side to render separate titles for left side and right side pages:

      <page-info var="Side" type="side" />
      <switch>
      <case var="Side" target="1" >
      <ManufacturerHead>{Manufacturer}</ManufacturerHead>
      </case>
      <case var="Side" target="2" >
      <MonthYearHead>{Month} {Year}</MonthYearHead>
      </case>
      </switch>
      
    • column-width — the maximum horizontal width of the area into which text is being composed, expressed in decipoints. If requested from within a:

      • Data block the value returned will be the width of the block. Refer to the Page Layout editor for a description of how data block dimensions are declared.

      • Page Footnote the value returned will be the width of the page print area in which the note is declared. Refer to the Page Layout editor for a description of how page dimensions are declared.

      • Column footnote the value returned will be the width of the data column block in which the note is declared. Refer to the Page Layout editor for a description of how data block dimensions are declared.

      • Sidenote the value returned will be the width of the sidenote block associated with the data column in which the sidenote is declared. Refer to the Page Layout editor for a description of how sidenote dimensions are declared.

      • Running Head the value returned will be the width of the data column block associated with the running head. Refer to the Page Layout editor for a description of how data column dimensions are declared.

      • Header/Footer the value returned will be the width of the Header/Footer fixed block. Refer to the Page Layout editor for a description of how fixed block dimensions are declared.

      The following example shows how to apply an optional compression to content that has a measured width that exceeds the width of the current setting region:

      <page-info var="MaxMeas" type="column-width" />
      <set var="DescMeas" string="{content}" info="measure" />
      <switch>
        <case var="Meas" target="{MaxMeas}" test="not-less">
          <Compress type="desc">{content}</Compress>
       </case>
       <case>{content}</case>
      </switch>
      
    • current-width — as for column-width above, except that current margins and other limits are taken into account. For example, when called within a table cell will return the cell width minus text indents and current margins.

    • column-height — the maximum vertical depth of the area into which text is being composed, expressed in decipoints. If requested from within a:

    The following example shows how to declare an ruler with a height that does not exceed 50% of the available height for the current setting region:

    <page-info var="Height" type="column-height" />
    <set var="Height" value="{Height}/2" />
    <rule width="5dp" height="{Height}dp" />
    

The <binding-properties/> command

Sets binding properties for the current element bind.

Where allowed

Any mapping.

Range of effect

Bound element content.

Attributes
allow-columnbreak

Specifies whether column breaks are permitted within bound content. The permitted values are:

  • yes — Content that is bound together must be rendered on the same page, but is permitted to break across column boundaries within multi-column layouts.

  • no — Content that is bound together must be rendered on the same page, or within a single column in a multi-column layout.

  • legacy — Content that is bound together must be rendered on the same page, or within a single column in a multi-column layout, unless an internal boundary is declared within the scope of that content. When the internal boundary is processed, TopLeaf will automatically cancel the binding. Content on either side of the internal boundary will appear on the same page, but a page break is permitted. The amount of content that is held together can be configured by adjusting the value of the minimum segment depth.

If not specified, the default value is legacy.

allow-pagebreak

Specifies whether page breaks are permitted within bound content. The permitted values are:

  • no — Content that is bound together must not appear on different pages.

  • legacy — Content that is bound together must not appear on different pages, unless an internal boundary is declared within the scope of that content. When the internal boundary is processed, TopLeaf will automatically cancel the binding. Content on either side of the internal boundary will appear on the same page, but a page break is permitted. The amount of content that is held together can be configured by adjusting the value of the minimum segment depth.

If not specified, the default value is legacy.

In the following example, bound content rendered within a multi-column layout must be rendered on the same page, but may break across columns:

<binding-properties allow-pagebreak="no" allow-columnbreak="yes" />
[Note] Note

Binding properties can only be declared at the outer most level of a bound content region. The application of binding properties to specific components within bound element content is not supported.