Use different page formats in the same document

Top Previous Topic Next Topic  Print this topic

Synopsis:

 

Sometimes you need to use different page formats in the same document. How do I do this?

 

Answer:

 

The XSL-FO language is designed to support complex page layouts, allowing you to define multiple page templates (masters). It also allows dynamically switching between defined layouts by supporting a set of rules dictating which template matches each page.

 

The XFD format inherits all the XSL-FO pagination elements and they are editable in XF Designer 2011 using the Pagination dialog bar. This tutorial explains how to create a document with alternating portrait and landscape pages.

 

We'll assume you're already working with a new document and having already attached a data source.

 

howto_page_layout1

 

The pagination dialog bar already shows a defined page template in the Page Layouts list - Letter Page. In the Pages list, you will see a page set called Page Set, referencing Letter Page. This means that the page set is using a standard letter format.

 

First, let's create the landscape page:

 

Right click on Page Layouts and click New Page Layout in the context menu.
Type the name for the new layout: Landscape Page and click OK. The Page Layout dialog will appear.
Select the Letter Landscape page format and click OK.

 

The pagination sidebar should look like this:

 

howto_page_layout0

 

Now let's use the new layout in the page set:

 

Double click on the Page Set to edit it.
In the Edit Page Set dialog, click Add and select Landscape Page. Set the condition to Even Pages.

 

The dialog should look like this:

 

 

howto_page_layout2

 

The page set should no longer reference Letter Page, but should instead use a more complex page master, ComplexMaster1.

 

Now to try it out. Write some text that causes page breaks and notice how the page layouts alternate: