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-breaking_5.xml 3.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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 normal breaking. It checks whether elements that don't fit on a
  21. page are sent over to the next if that one has more room (indirectly checks
  22. changing available BPD, too).
  23. </p>
  24. </info>
  25. <fo>
  26. <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" widows="0" orphans="0">
  27. <fo:layout-master-set>
  28. <fo:simple-page-master master-name="short" page-height="30pt" page-width="120pt">
  29. <fo:region-body/>
  30. </fo:simple-page-master>
  31. <fo:simple-page-master master-name="long" page-height="100pt" page-width="120pt">
  32. <fo:region-body/>
  33. </fo:simple-page-master>
  34. <fo:page-sequence-master master-name="master">
  35. <fo:single-page-master-reference master-reference="long"/>
  36. <fo:single-page-master-reference master-reference="short"/>
  37. <fo:single-page-master-reference master-reference="long"/>
  38. </fo:page-sequence-master>
  39. </fo:layout-master-set>
  40. <fo:page-sequence master-reference="master">
  41. <fo:flow flow-name="xsl-region-body">
  42. <fo:block background-color="orange" keep-together.within-page="always">Apache FOP is a great tool to create PDF documents with.</fo:block>
  43. <fo:block background-color="orange" keep-together.within-page="always">Apache FOP is a great tool to create PDF documents with.</fo:block>
  44. <fo:block background-color="orange" keep-together.within-page="always">Apache FOP is a great tool to create PDF documents with.</fo:block>
  45. <fo:block background-color="orange" keep-together.within-page="always">Apache FOP is a great tool to create PDF documents with.</fo:block>
  46. <fo:block background-color="yellow">last line in new block</fo:block>
  47. </fo:flow>
  48. </fo:page-sequence>
  49. </fo:root>
  50. </fo>
  51. <checks>
  52. <eval expected="4" xpath="count(//pageViewport)"/>
  53. <eval expected="6" xpath="sum(//pageViewport[@nr=1]/page/regionViewport/regionBody/mainReference/span/flow/block/@bpda) div 14400"/>
  54. <!-- the second page should be empty since the third block doesn't fit into that page with only 30pt BPD -->
  55. <eval expected="0" xpath="sum(//pageViewport[@nr=2]/page/regionViewport/regionBody/mainReference/span/flow/block/@bpda) div 14400"/>"/>
  56. <eval expected="6" xpath="sum(//pageViewport[@nr=3]/page/regionViewport/regionBody/mainReference/span/flow/block/@bpda) div 14400"/>"/>
  57. <eval expected="1" xpath="sum(//pageViewport[@nr=4]/page/regionViewport/regionBody/mainReference/span/flow/block/@bpda) div 14400"/>"/>
  58. </checks>
  59. </testcase>