About Arbortext Styler > Creating Conditions > Using Conditions to Change a Document's Page Size
  
Using Conditions to Change a Document's Page Size
This topic walks you through creating a condition that changes the page size for a print or PDF document if a particular attribute is specified for the document.
Example: Creating a Condition that Changes a Document's Page Size
1. In Arbortext Editor, open the transport.xml document located at Arbortext-path/samples/styler.
2. Choose File > Save As to create a local copy of transport.xml.
3. Choose Styler > New Stylesheet to create a new stylesheet.
4. In the Page Sets list, choose the menu option Insert > Page Set. The Page Sets list opens, with a new page set object named NewPageSet created in the list.
5. Type Page Set 11x17 as the Page set name then go to the Page size category.
6. Choose 11x17 from the Page size drop down list.
7. In the Page Sets list, insert a second new page set via the Insert > Page Set menu option.
8. Type Page Set 7x9 as the Page set name then go to the Page size category.
9. Choose Custom from the Page size drop down list, then set Width to 7in and Height to 9in.
10. In the Elements list, select the book everywhere context and go to the Breaks category.
11. Choose Page Set 11x17 from the Name drop down list in the Page set field.
12. In the Elements list, select the book everywhere context and insert a condition with the Insert > Condition menu option.
13. In the Condition dialog box, click New Attribute Test to open the Attribute Test dialog box. Ensure that book is shown as the Current Element in the Test attribute of field.
14. Choose role as the Attribute Name.
15. Choose Comparison = as the Attribute Value operator then type small in the associated text box.
16. Click OK to save the test and OK to save the condition and exit the Condition dialog box.
17. Highlight the condition you just created (If attribute “role” = “small”) in the Elements list and go to the Breaks category.
18. Set Start new to Page, and Name in the Page set group to Page Set 7x9.
The condition you have created will advise Arbortext Styler to size the transport.xml document using the Page Set 11x17 page set, unless the attribute emphasis role=”small” has been specified for the document. In the latter case the document will be sized according to the Page Set 7x9 page set.
19. Choose Preview > Print.
In the Print Preview window, note that the page size of the document is now 11in x 17in.
20. In Arbortext Editor, give the book element a role attribute with a value of “small”.
21. In Arbortext Styler, choose Preview > Print (XSL-FO) again.
In the Print Preview window, note that the page size of the document is now 7in x 9in.