cmp182_
cmp182_

Reputation: 63

Skip a page in XSL-FO?

I am looking for a way to force the flow in my document to skip a page. What I have so far is this (layout):

<fo:layout-master-set>
                    <fo:page-sequence-master master-name="document">
                        <fo:repeatable-page-master-alternatives maximum-repeats="2">
                            <fo:conditional-page-master-reference master-reference="letter" odd-or-even="odd"/>
                            <fo:conditional-page-master-reference master-reference="back-special" odd-or-even="even"/>
                        </fo:repeatable-page-master-alternatives>
                        <fo:repeatable-page-master-alternatives>
                            <fo:conditional-page-master-reference master-reference="continuation" odd-or-even="odd"/>
                            <fo:conditional-page-master-reference master-reference="back" odd-or-even="even"/>
                        </fo:repeatable-page-master-alternatives>
                    </fo:page-sequence-master>
                        <fo:simple-page-master master-name="letter" page-height="32.0cm" page-width="22.5cm" margin-top="12.2cm" margin-bottom="3cm" margin-left="2.3cm" margin-right="0.75cm">
                            <fo:region-body/>
                            <fo:region-before region-name="omr" extent="29.7cm"/>
                        </fo:simple-page-master>
                        <fo:simple-page-master master-name="back" page-height="32.0cm" page-width="22.5cm" margin-top="5.2cm" margin-bottom="1.8cm" margin-left="2.3cm" margin-right="2.0cm"  >
                            <fo:region-body/>
                            <fo:region-before region-name="omr-rest" extent="29.7cm"/>
                        </fo:simple-page-master>
                        <fo:simple-page-master master-name="continuation" page-height="32.0cm" page-width="22.5cm" margin-top="5.2cm" margin-bottom="1.8cm" margin-left="2.3cm" margin-right="2.0cm"  >
                            <fo:region-body/>
                            <fo:region-before region-name="conts" extent="29.7cm"/>
                        </fo:simple-page-master>
                        <fo:simple-page-master master-name="back-special" page-height="32cm" page-width="22.5cm" margin-top="5cm" margin-bottom="25cm" margin-left="2.5cm" margin-right="2.5cm">
                            <fo:region-body/>
                            <fo:region-before region-name="special" extent="29.7cm"/>
                        </fo:simple-page-master>
                        <fo:simple-page-master master-name="separator" page-height="32.0cm" page-width="22.5cm" margin-top="2.15cm" margin-bottom="1.15cm" margin-left="1.75cm" margin-right="0.75cm">
                            <fo:region-body/>
                        </fo:simple-page-master>
                </fo:layout-master-set>

and then a table, which refers to an external data source, within the flow:

                    <fo:table>
                    <fo:table-column column-width="1.8cm"/>
                    <fo:table-column column-width="5cm"/>
                    <fo:table-column column-width="3.2cm"/>
                    <fo:table-column column-width="3.8cm"/>
                    <fo:table-column column-width="4.0cm"/>
                     <fo:table-body space-after="1cm" space-before="1cm">
                       <xsl:for-each select="rems/rem">
                        <fo:table-row height="0.8cm" keep-together.within-column="always">
                            <fo:table-cell>
                                <fo:block font-family="Helvetica" font-size="8pt" text-align="left" ><xsl:value-of select="rem3"/></fo:block> <!--date-->
                            </fo:table-cell>
                            <fo:table-cell>
                               <fo:block font-family="Helvetica" font-size="8pt" text-align="left" ><xsl:value-of select="rem4"/></fo:block>  <!--details 1-->
                               <fo:block font-family="Helvetica" font-size="8pt" text-align="left" ><xsl:value-of select="rem5"/></fo:block>  <!--details 2-->
                               <fo:block font-family="Helvetica" font-size="8pt" text-align="left" ><xsl:value-of select="rem6"/></fo:block>  <!--details 3-->
                               <fo:block font-family="Helvetica" font-size="8pt" text-align="left" ><xsl:value-of select="rem7"/></fo:block>  <!--details 4-->
                            </fo:table-cell>
                            <fo:table-cell>
                               <fo:block font-family="Helvetica" font-size="8pt" text-align="right" ><xsl:value-of select="rem8"/></fo:block> <!--payments-->
                            </fo:table-cell>
                            <fo:table-cell>
                               <fo:block font-family="Helvetica" font-size="8pt" text-align="right" ><xsl:value-of select="rem9"/></fo:block>  <!--receipts-->
                            </fo:table-cell>
                            <fo:table-cell>
                               <fo:block font-family="Helvetica" font-size="8pt" text-align="right" ><xsl:value-of select="rem10"/></fo:block>  <!--balance-->
                            </fo:table-cell>
                        </fo:table-row>
                        </xsl:for-each>
                    </fo:table-body>                        
                </fo:table>

What I am trying to achieve is a primary document, with the beginning of the table, the next page (back-special) is to be blank (with a full page graphic), and the flow to skip this page entirely, before continuing on a continuation page (page 3 'continuation').

If I were to increase the top & bottom margin of "back-special" any more than they are, I get an error as follows: "UnsupportedOperationException: Don't know how to restart at positionNonLeafPos:26"...etc

I have read that it is a known issue in FOP, so I was just wondering if anyone has any suggestions to get around this.

Upvotes: 1

Views: 768

Answers (1)

Hobbes
Hobbes

Reputation: 2115

You can achieve this by using different region-names for the Body region of the masterpages, see this question: Place text on odd pages only, skip even pages

Upvotes: 1

Related Questions