You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

page-sequence-force-page-count-odd.xml 5.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed to the Apache Software Foundation (ASF) under one or more
  4. contributor license agreements. See the NOTICE file distributed with
  5. this work for additional information regarding copyright ownership.
  6. The ASF licenses this file to You under the Apache License, Version 2.0
  7. (the "License"); you may not use this file except in compliance with
  8. the License. You may obtain a copy of the License at
  9. http://www.apache.org/licenses/LICENSE-2.0
  10. Unless required by applicable law or agreed to in writing, software
  11. distributed under the License is distributed on an "AS IS" BASIS,
  12. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. See the License for the specific language governing permissions and
  14. limitations under the License.
  15. -->
  16. <!-- $Id$ -->
  17. <testcase>
  18. <info>
  19. <p>
  20. This checks that when force-page-count that the last simple-
  21. page-master is used when a single page overflows to a second
  22. page and the page count is forced to odd.
  23. </p>
  24. </info>
  25. <variables>
  26. <img>../resources/images/bgimg300dpi.jpg</img>
  27. </variables>
  28. <fo>
  29. <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
  30. <fo:layout-master-set>
  31. <fo:simple-page-master master-name="simple-first" page-width="210mm" page-height="297mm" margin-bottom="0mm" margin-right="0mm" margin-top="0mm" margin-left="0mm">
  32. <fo:region-body region-name="body"/>
  33. <fo:region-before region-name="first-before" extent="100mm"/>
  34. <fo:region-after region-name="first-after" extent="23mm"/>
  35. </fo:simple-page-master>
  36. <fo:simple-page-master master-name="simple-first-space" page-width="210mm" page-height="297mm" margin-bottom="0mm" margin-right="0mm" margin-top="0mm" margin-left="0mm">
  37. <fo:region-body margin-bottom="115mm" margin-right="20mm" margin-top="0mm" margin-left="23mm" region-name="body"/>
  38. <fo:region-before background-position-horizontal="150mm" background-repeat="no-repeat" background-position-vertical="10mm" region-name="first-before" extent="70mm"/>
  39. <fo:region-after region-name="first-after-space" extent="110mm"/>
  40. </fo:simple-page-master>
  41. <fo:simple-page-master master-name="simple-rest" page-width="210mm" page-height="297mm" margin-bottom="0mm" margin-right="0mm" margin-top="0mm" margin-left="0mm">
  42. <fo:region-body background-color="green" margin-bottom="25mm" margin-right="20mm" margin-top="70mm" margin-left="23mm" region-name="body"/>
  43. <fo:region-before background-position-horizontal="150mm" background-repeat="no-repeat" background-position-vertical="10mm" region-name="rest-before" extent="70mm"/>
  44. <fo:region-after region-name="rest-after" extent="23mm"/>
  45. </fo:simple-page-master>
  46. <fo:simple-page-master master-name="simple-last" page-width="210mm" page-height="297mm" margin-bottom="0mm" margin-right="0mm" margin-top="0mm" margin-left="0mm">
  47. <fo:region-body background-color="blue" margin-top="70mm" margin-bottom="115mm" margin-right="22mm" margin-left="25mm" region-name="body"/>
  48. <fo:region-before background-position-horizontal="150mm" background-repeat="no-repeat" background-position-vertical="10mm" region-name="last-before" extent="70mm"/>
  49. <fo:region-after extent="111mm" region-name="last-after"/>
  50. </fo:simple-page-master>
  51. <fo:page-sequence-master master-name="psm">
  52. <fo:repeatable-page-master-alternatives>
  53. <fo:conditional-page-master-reference page-position="only" master-reference="simple-first-space"/>
  54. <fo:conditional-page-master-reference page-position="first" master-reference="simple-first"/>
  55. <fo:conditional-page-master-reference page-position="rest" master-reference="simple-rest"/>
  56. <fo:conditional-page-master-reference page-position="last" master-reference="simple-last"/>
  57. </fo:repeatable-page-master-alternatives>
  58. </fo:page-sequence-master>
  59. </fo:layout-master-set>
  60. <fo:page-sequence format="1" force-page-count="odd" master-reference="psm">
  61. <fo:static-content flow-name="first-before">
  62. <fo:block>
  63. </fo:block>
  64. </fo:static-content>
  65. <fo:static-content flow-name="first-after-space">
  66. <fo:block page-break-before="always" page-break-after="always">
  67. </fo:block>
  68. </fo:static-content>
  69. <fo:static-content flow-name="first-after">
  70. <fo:block margin-right="20mm" margin-left="23mm">
  71. </fo:block>
  72. </fo:static-content>
  73. <fo:static-content flow-name="rest-before">
  74. <fo:block>
  75. </fo:block>
  76. </fo:static-content>
  77. <fo:static-content flow-name="last-before">
  78. <fo:block>
  79. </fo:block>
  80. </fo:static-content>
  81. <fo:static-content flow-name="rest-after">
  82. <fo:block margin-right="20mm" margin-left="23mm">
  83. </fo:block>
  84. </fo:static-content>
  85. <fo:static-content flow-name="last-after">
  86. <fo:block>
  87. </fo:block>
  88. </fo:static-content>
  89. <fo:flow flow-name="body">
  90. <fo:block-container>
  91. <fo:block margin-top="88mm">
  92. <fo:block space-after="120mm">line 1</fo:block>
  93. <fo:block space-after="60mm">line 2</fo:block>
  94. </fo:block>
  95. </fo:block-container>
  96. </fo:flow>
  97. </fo:page-sequence>
  98. </fo:root>
  99. </fo>
  100. <checks>
  101. <eval expected="simple-first" xpath="//pageViewport[1]/@simple-page-master-name"/>
  102. <eval expected="simple-rest" xpath="//pageViewport[2]/@simple-page-master-name"/>
  103. <eval expected="simple-last" xpath="//pageViewport[3]/@simple-page-master-name"/>
  104. <eval expected="3" xpath="count(//pageViewport)"/>
  105. </checks>
  106. </testcase>