Display 2 pages side by side in landscape orientation

Top Previous Topic Next Topic  Print this topic

Overview:

Sometimes, portrait pages must be displayed side by side, on the same landscape page.

 

Solution:

There are 2 different methods to achieve this:

 

1. Using the xf:spread and xf:split-sheet-pages attributes.

 

These attributes must be added to fo:page-sequence, as follows:

 

 

       <fo:page-sequence master-reference="all-pages" xf:spread="true" xf:split-sheet-pages="false">

 

 

This solution will also repeat page headers and footers. It has, basically, the same result as placing two pages side by side. If the total page count is odd, the last page will be displayed as a normal page.

 

Example of usage:

 

 

<?xml version="1.0" encoding="utf-8"?>

<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:xf="http://www.ecrion.com/xf/1.0" xmlns:xc="http://www.ecrion.com/2008/xc" xmlns:svg="http://www.w3.org/2000/svg" font-family="Times" font-size="12pt"><fo:layout-master-set>

               <fo:simple-page-master master-name="Letter Page" page-width="8.500in" page-height="5.000in">

                       <fo:region-body region-name="xsl-region-body" margin-left="0.700in" margin-right="0.700in" margin-top="0.700in" margin-bottom="0.700in"/>

                       <fo:region-before region-name="xsl-region-before" display-align="after" extent="0.700in"/>

                       <fo:region-after region-name="xsl-region-after" display-align="before" extent="0.700in"/>

                       <fo:region-start region-name="xsl-region-start" extent="0.700in"/>

                       <fo:region-end region-name="xsl-region-end" extent="0.700in"/>

               </fo:simple-page-master>

       </fo:layout-master-set>

       <fo:page-sequence master-reference="Letter Page" xf:spread="true" xf:split-sheet-pages="false">

               <fo:static-content flow-name="xsl-region-after" font-family="Times" font-size="12pt">

                       <fo:block><fo:inline font-size="20pt">Footer</fo:inline></fo:block>

               </fo:static-content><fo:static-content flow-name="xsl-region-before" font-family="Times" font-size="12pt">

                       <fo:block><fo:inline font-size="20pt">Page <fo:page-number format="1"/></fo:inline></fo:block>

               </fo:static-content><fo:static-content flow-name="xsl-region-end" font-family="Times" font-size="12pt">

                       <fo:block> </fo:block>

               </fo:static-content><fo:static-content flow-name="xsl-region-start" font-family="Times" font-size="12pt">

                       <fo:block> </fo:block>

               </fo:static-content><fo:flow flow-name="xsl-region-body">

                       <fo:block>

                       Text here Text here Text here Text here Text here Text here Text here Text here Text here Text here Text here                        

                       Text here Text here Text here Text here Text here Text here Text here Text here Text here Text here Text here                        

                       Text here Text here Text here Text here Text here Text here Text here Text here Text here Text here Text here                        

                       Text here Text here Text here Text here Text here Text here Text here Text here Text here Text here Text here                        

                       Text here Text here Text here Text here Text here Text here Text here Text here Text here Text here Text here                        

                       Text here Text here Text here Text here Text here Text here Text here Text here Text here Text here Text here                        

                       </fo:block>

                       <fo:block>

                       Text here Text here Text here Text here Text here Text here Text here Text here Text here Text here Text here                        

                       Text here Text here Text here Text here Text here Text here Text here Text here Text here Text here Text here                        

                       Text here Text here Text here Text here Text here Text here Text here Text here Text here Text here Text here                        

                       Text here Text here Text here Text here Text here Text here Text here Text here Text here Text here Text here                        

                       Text here Text here Text here Text here Text here Text here Text here Text here Text here Text here Text here                        

                       Text here Text here Text here Text here Text here Text here Text here Text here Text here Text here Text here

                       </fo:block>

                       <fo:block>

                       Text here Text here Text here Text here Text here Text here Text here Text here Text here Text here Text here                        

                       Text here Text here Text here Text here Text here Text here Text here Text here Text here Text here Text here                        

                       Text here Text here Text here Text here Text here Text here Text here Text here Text here Text here Text here                        

                       Text here Text here Text here Text here Text here Text here Text here Text here Text here Text here Text here                        

                       Text here Text here Text here Text here Text here Text here Text here Text here Text here Text here Text here                        

                       Text here Text here Text here Text here Text here Text here Text here Text here Text here Text here Text here                        

                       Text here Text here Text here Text here Text here Text here Text here Text here Text here Text here Text here                        

                       Text here Text here Text here Text here Text here Text here Text here Text here Text here Text here Text here                        

                       Text here Text here Text here Text here Text here Text here Text here Text here Text here Text here Text here                        

                       Text here Text here Text here Text here Text here Text here Text here Text here Text here Text here Text here                        

                       Text here Text here Text here Text here Text here Text here Text here Text here Text here Text here Text here                        

                       Text here Text here Text here Text here Text here Text here Text here Text here Text here Text here Text here                        

                       </fo:block>

               </fo:flow>

       </fo:page-sequence>

</fo:root>

 

 

Output:

 

how_to_display_2_pages_1

 

 

2. Using the span extension

 

A landscape page layout with 2 columns must be created. To create a landscape page, the user must make sure that the Pagination pane is displayed. To display it, the user must enable the Pagination option, located in the Show/Hide group, under the View tab.

Then, the user must right click on the Layouts heading and select Add Page Layout. After the page layout's name has been type in, the Page Layout dialog, from where the landscape orientation and column count can be chosen, will be displayed.

 

Afterwards, the user must only type in the desired text and it will be displayed on the landscape page in two columns.

 

Output:

 

how_to_display_2_pages_2