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_bug42576.xml 7.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  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 test checks the force-page-count property
  21. using three identical page sequences refering to the same
  22. page sequence master, odd pages should be blank.
  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="first" page-height="297mm" page-width="210mm" margin-top="20mm" margin-bottom="20mm" margin-left="25mm" margin-right="25mm">
  32. <fo:region-body margin-bottom="20mm"/>
  33. <fo:region-before region-name="header-first" extent="10mm"/>
  34. </fo:simple-page-master>
  35. <fo:simple-page-master master-name="normal" page-height="297mm" page-width="210mm" margin-top="20mm" margin-bottom="20mm" margin-left="25mm" margin-right="25mm">
  36. <fo:region-body margin-bottom="20mm"/>
  37. <fo:region-before region-name="header-normal" extent="10mm"/>
  38. <fo:region-after region-name="footer-normal" extent="10mm"/>
  39. </fo:simple-page-master>
  40. <fo:simple-page-master master-name="blank" page-height="297mm" page-width="210mm" margin-top="20mm" margin-bottom="20mm" margin-left="25mm" margin-right="25mm">
  41. <fo:region-body/>
  42. <fo:region-before region-name="header-blank" extent="297mm"/>
  43. </fo:simple-page-master>
  44. <fo:page-sequence-master master-name="document">
  45. <fo:single-page-master-reference master-reference="first"/>
  46. <fo:repeatable-page-master-alternatives>
  47. <fo:conditional-page-master-reference blank-or-not-blank="not-blank" master-reference="normal"/>
  48. <fo:conditional-page-master-reference blank-or-not-blank="blank" master-reference="blank"/>
  49. </fo:repeatable-page-master-alternatives>
  50. </fo:page-sequence-master>
  51. </fo:layout-master-set>
  52. <fo:page-sequence master-reference="document" force-page-count="end-on-even">
  53. <fo:static-content flow-name="footer-normal">
  54. <fo:block text-align="center">Normal footer</fo:block>
  55. </fo:static-content>
  56. <fo:static-content flow-name="header-first">
  57. <fo:block text-align="center">FIRST PAGE OF SEQUENCE</fo:block>
  58. </fo:static-content>
  59. <fo:static-content flow-name="header-normal">
  60. <fo:block text-align="center">Normal Non-blank page</fo:block>
  61. </fo:static-content>
  62. <fo:static-content flow-name="header-blank">
  63. <fo:block space-before="100mm" text-align-last="center">
  64. Intentionally left blank.</fo:block>
  65. </fo:static-content>
  66. <fo:flow flow-name="xsl-region-body">
  67. <fo:block break-after="page">
  68. TEST PAGE 1
  69. </fo:block>
  70. <fo:block break-after="page">
  71. TEST PAGE 2
  72. </fo:block>
  73. <fo:block>
  74. TEST PAGE 3
  75. </fo:block>
  76. </fo:flow>
  77. </fo:page-sequence>
  78. <fo:page-sequence master-reference="document" force-page-count="end-on-even">
  79. <fo:static-content flow-name="footer-normal">
  80. <fo:block text-align="center">Normal footer</fo:block>
  81. </fo:static-content>
  82. <fo:static-content flow-name="header-first">
  83. <fo:block text-align="center">FIRST PAGE OF SEQUENCE</fo:block>
  84. </fo:static-content>
  85. <fo:static-content flow-name="header-normal">
  86. <fo:block text-align="center">Normal Non-blank page</fo:block>
  87. </fo:static-content>
  88. <fo:static-content flow-name="header-blank">
  89. <fo:block space-before="100mm" text-align-last="center">
  90. Intentionally left blank.</fo:block>
  91. </fo:static-content>
  92. <fo:flow flow-name="xsl-region-body">
  93. <fo:block break-after="page">
  94. TEST PAGE 1
  95. </fo:block>
  96. <fo:block break-after="page">
  97. TEST PAGE 2
  98. </fo:block>
  99. <fo:block>
  100. TEST PAGE 3
  101. </fo:block>
  102. </fo:flow>
  103. </fo:page-sequence>
  104. <fo:page-sequence master-reference="document" force-page-count="end-on-even">
  105. <fo:static-content flow-name="footer-normal">
  106. <fo:block text-align="center">Normal footer</fo:block>
  107. </fo:static-content>
  108. <fo:static-content flow-name="header-first">
  109. <fo:block text-align="center">FIRST PAGE OF SEQUENCE</fo:block>
  110. </fo:static-content>
  111. <fo:static-content flow-name="header-normal">
  112. <fo:block text-align="center">Normal Non-blank page</fo:block>
  113. </fo:static-content>
  114. <fo:static-content flow-name="header-blank">
  115. <fo:block space-before="100mm" text-align-last="center">
  116. Intentionally left blank.</fo:block>
  117. </fo:static-content>
  118. <fo:flow flow-name="xsl-region-body">
  119. <fo:block break-after="page">
  120. TEST PAGE 1
  121. </fo:block>
  122. <fo:block break-after="page">
  123. TEST PAGE 2
  124. </fo:block>
  125. <fo:block>
  126. TEST PAGE 3
  127. </fo:block>
  128. </fo:flow>
  129. </fo:page-sequence>
  130. </fo:root>
  131. </fo>
  132. <checks>
  133. <eval expected="3" xpath="count(//pageSequence)"/>
  134. <eval expected="3" xpath="count(//pageSequence/pageViewport[@simple-page-master-name='first'])"/>
  135. <eval expected="6" xpath="count(//pageSequence/pageViewport[@simple-page-master-name='normal'])"/>
  136. <eval expected="3" xpath="count(//pageSequence/pageViewport[@simple-page-master-name='blank'])"/>
  137. <eval expected="1" xpath="count(//pageSequence/pageViewport[@nr=1 and @simple-page-master-name='first'])"/>
  138. <eval expected="1" xpath="count(//pageSequence/pageViewport[@nr=2 and @simple-page-master-name='normal'])"/>
  139. <eval expected="1" xpath="count(//pageSequence/pageViewport[@nr=3 and @simple-page-master-name='normal'])"/>
  140. <eval expected="1" xpath="count(//pageSequence/pageViewport[@nr=4 and @simple-page-master-name='blank'])"/>
  141. <eval expected="1" xpath="count(//pageSequence/pageViewport[@nr=5 and @simple-page-master-name='first'])"/>
  142. <eval expected="1" xpath="count(//pageSequence/pageViewport[@nr=6 and @simple-page-master-name='normal'])"/>
  143. <eval expected="1" xpath="count(//pageSequence/pageViewport[@nr=7 and @simple-page-master-name='normal'])"/>
  144. <eval expected="1" xpath="count(//pageSequence/pageViewport[@nr=8 and @simple-page-master-name='blank'])"/>
  145. <eval expected="1" xpath="count(//pageSequence/pageViewport[@nr=9 and @simple-page-master-name='first'])"/>
  146. <eval expected="1" xpath="count(//pageSequence/pageViewport[@nr=10 and @simple-page-master-name='normal'])"/>
  147. <eval expected="1" xpath="count(//pageSequence/pageViewport[@nr=11 and @simple-page-master-name='normal'])"/>
  148. <eval expected="1" xpath="count(//pageSequence/pageViewport[@nr=12 and @simple-page-master-name='blank'])"/>
  149. </checks>
  150. </testcase>