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.

external-graphic_svg.xml 4.7KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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 external-graphics.
  21. </p>
  22. </info>
  23. <fo>
  24. <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg"
  25. xmlns:fox="http://xmlgraphics.apache.org/fop/extensions">
  26. <fo:layout-master-set>
  27. <fo:simple-page-master master-name="normal" page-width="10in" page-height="15in">
  28. <fo:region-body/>
  29. </fo:simple-page-master>
  30. </fo:layout-master-set>
  31. <fo:page-sequence master-reference="normal" white-space-collapse="true">
  32. <fo:flow flow-name="xsl-region-body">
  33. <fo:block text-align="left">2 inch wide SVG external-graphic on LHS</fo:block>
  34. <fo:block text-align="left">
  35. <fo:external-graphic src="../../resources/images/img.svg" content-width="2in" scaling="uniform" />EOG
  36. </fo:block>
  37. <fo:block text-align="right">4 inch wide SVG external-graphic on RHS</fo:block>
  38. <fo:block text-align="right">
  39. <fo:external-graphic src="../../resources/images/img.svg" content-width="4in" scaling="uniform" />EOG
  40. </fo:block>
  41. <fo:block text-align="center">6 inch wide SVG external-graphic in center, non-uniformly squeezed to a height of 4in.</fo:block>
  42. <fo:block text-align="center">
  43. <fo:external-graphic src="../../resources/images/img.svg" content-width="6in" content-height="4in" scaling="non-uniform" />EOG
  44. </fo:block>
  45. <fo:block text-align="left">SVG external-graphic with an intrinsic size (16ptx16pt)</fo:block>
  46. <fo:block text-align="left">
  47. <fo:external-graphic src="../../resources/images/img-w-size.svg"/>EOG
  48. </fo:block>
  49. <fo:block text-align="left">SVG external-graphic with an intrinsic size and fox:conversion-mode="bitmap"</fo:block>
  50. <fo:block text-align="left">
  51. <fo:external-graphic src="../../resources/images/img-w-size.svg"
  52. fox:conversion-mode="bitmap"/>EOG
  53. </fo:block>
  54. <fo:block>EOF</fo:block>
  55. </fo:flow>
  56. </fo:page-sequence>
  57. </fo:root>
  58. </fo>
  59. <checks>
  60. <eval expected="144000" xpath="//flow/block[2]/lineArea/viewport/@ipd"/>
  61. <eval expected="144000" xpath="//flow/block[2]/lineArea/viewport/@ipda"/>
  62. <eval expected="144000" xpath="//flow/block[2]/lineArea/viewport/@bpd"/>
  63. <eval expected="144000" xpath="//flow/block[2]/lineArea/viewport/@bpda"/>
  64. <eval expected="0 0 144000 144000" xpath="//flow/block[2]/lineArea/viewport/@pos"/>
  65. <eval expected="288000" xpath="//flow/block[4]/lineArea/viewport/@ipd"/>
  66. <eval expected="288000" xpath="//flow/block[4]/lineArea/viewport/@ipda"/>
  67. <eval expected="288000" xpath="//flow/block[4]/lineArea/viewport/@bpd"/>
  68. <eval expected="288000" xpath="//flow/block[4]/lineArea/viewport/@bpda"/>
  69. <eval expected="0 0 288000 288000" xpath="//flow/block[4]/lineArea/viewport/@pos"/>
  70. <eval expected="432000" xpath="//flow/block[6]/lineArea/viewport/@ipd"/>
  71. <eval expected="432000" xpath="//flow/block[6]/lineArea/viewport/@ipda"/>
  72. <eval expected="288000" xpath="//flow/block[6]/lineArea/viewport/@bpd"/>
  73. <eval expected="288000" xpath="//flow/block[6]/lineArea/viewport/@bpda"/>
  74. <eval expected="0 0 432000 288000" xpath="//flow/block[6]/lineArea/viewport/@pos"/>
  75. <!-- TODO: This evaluates nicely to 16000mpt with 72dpi in the FOUserAgent but will result
  76. in 16080 for 300dpi which is caused by rounding errors because pixels are used internally. -->
  77. <eval expected="16000" xpath="//flow/block[8]/lineArea/viewport/@ipd"/>
  78. <eval expected="16000" xpath="//flow/block[8]/lineArea/viewport/@ipda"/>
  79. <eval expected="16000" xpath="//flow/block[8]/lineArea/viewport/@bpd"/>
  80. <eval expected="16000" xpath="//flow/block[8]/lineArea/viewport/@bpda"/>
  81. <eval expected="0 0 16000 16000" xpath="//flow/block[8]/lineArea/viewport/@pos"/>
  82. </checks>
  83. </testcase>