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.

instream.fo 4.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg">
  2. <fo:layout-master-set>
  3. <fo:simple-page-master master-name="one">
  4. <fo:region-body margin-top="25pt" margin-bottom="25pt" margin-left="50pt" margin-right="50pt" />
  5. </fo:simple-page-master>
  6. </fo:layout-master-set>
  7. <fo:page-sequence master-reference="one">
  8. <fo:flow flow-name="xsl-region-body">
  9. <fo:block>This is used to show how foreign objects are placed in a line area.</fo:block>
  10. <fo:block>
  11. Some block text to separate instream objects.
  12. </fo:block>
  13. <fo:block>
  14. Some text before
  15. <fo:instream-foreign-object>
  16. <svg:svg width="20" height="20">
  17. <svg:g style="fill:red; stroke:#000000">
  18. <svg:rect x="0" y="0" width="15" height="15"/>
  19. <svg:rect x="5" y="5" width="15" height="15"/>
  20. </svg:g>
  21. </svg:svg>
  22. </fo:instream-foreign-object>
  23. and some after the svg element.
  24. </fo:block>
  25. <fo:block>
  26. A text line below the instream object.
  27. </fo:block>
  28. <fo:block>
  29. <fo:instream-foreign-object>
  30. <svg:svg width="250" height="50">
  31. <svg:g style="fill:red; stroke:#000000">
  32. <svg:rect x="0" y="0" width="15" height="15"/>
  33. <svg:rect x="5" y="5" width="15" height="15"/>
  34. </svg:g>
  35. <svg:text style="font-family:Helvetica;fill:blue" x="10" y="30">SVG placed in a block</svg:text>
  36. </svg:svg>
  37. </fo:instream-foreign-object>
  38. </fo:block>
  39. <fo:block>
  40. A text line below the block.
  41. </fo:block>
  42. <fo:block>
  43. A text line with an instream foreign object that is before the line break.
  44. <fo:instream-foreign-object>
  45. <svg:svg width="50" height="50">
  46. <svg:g style="fill:red; stroke:#000000">
  47. <svg:rect x="0" y="0" width="15" height="15"/>
  48. <svg:rect x="5" y="5" width="15" height="15"/>
  49. </svg:g>
  50. <svg:rect style="fill:none;stroke:black" x="0" y="0" width="49" height="49"/>
  51. </svg:svg>
  52. </fo:instream-foreign-object>
  53. With some text on the next line. With a bit more text to go over the to the next line.
  54. </fo:block>
  55. <fo:block>
  56. A text line with an instream foreign object that is after the line break.
  57. With some text on the next line. With a bit
  58. <fo:instream-foreign-object>
  59. <svg:svg width="50" height="50">
  60. <svg:g style="fill:red; stroke:#000000">
  61. <svg:rect x="0" y="0" width="15" height="15"/>
  62. <svg:rect x="5" y="5" width="15" height="15"/>
  63. </svg:g>
  64. <svg:rect style="fill:none;stroke:black" x="0" y="0" width="49" height="49"/>
  65. </svg:svg>
  66. </fo:instream-foreign-object>
  67. more text to go over the to the next line.
  68. </fo:block>
  69. <fo:block>
  70. A text line with an instream foreign object that is over the line break.
  71. With some text
  72. <fo:instream-foreign-object>
  73. <svg:svg width="50" height="50">
  74. <svg:g style="fill:red; stroke:#000000">
  75. <svg:rect x="0" y="0" width="15" height="15"/>
  76. <svg:rect x="5" y="5" width="15" height="15"/>
  77. </svg:g>
  78. <svg:rect style="fill:none;stroke:black" x="0" y="0" width="49" height="49"/>
  79. </svg:svg>
  80. </fo:instream-foreign-object>
  81. on the next line. With a bit more text to go over the to the next line to
  82. see it handles it properly.
  83. </fo:block>
  84. <fo:block>
  85. The next block has an instream object wider than the area.
  86. </fo:block>
  87. <fo:block>
  88. <fo:instream-foreign-object>
  89. <svg:svg width="550" height="50">
  90. <svg:g style="fill:red; stroke:#000000">
  91. <svg:rect x="0" y="0" width="15" height="15"/>
  92. <svg:rect x="5" y="5" width="15" height="15"/>
  93. </svg:g>
  94. <svg:rect style="fill:none;stroke:black" x="0" y="0" width="549" height="49"/>
  95. <svg:text x="10" y="30">SVG placed in a really wide block</svg:text>
  96. </svg:svg>
  97. </fo:instream-foreign-object>
  98. </fo:block>
  99. <fo:block>
  100. This block has an instream object wider than the area after this text
  101. <fo:instream-foreign-object>
  102. <svg:svg width="550" height="50">
  103. <svg:g style="fill:red; stroke:#000000">
  104. <svg:rect x="0" y="0" width="15" height="15"/>
  105. <svg:rect x="5" y="5" width="15" height="15"/>
  106. </svg:g>
  107. <svg:rect style="fill:none;stroke:black" x="0" y="0" width="549" height="49"/>
  108. <svg:text style="font-family:Helvetica" x="10" y="30">SVG placed in a really wide block</svg:text>
  109. </svg:svg>
  110. </fo:instream-foreign-object>
  111. </fo:block>
  112. </fo:flow>
  113. </fo:page-sequence>
  114. </fo:root>