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.

images.fo 9.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <fo:root font-family="Times Roman" font-size="12pt" text-align="center"
  3. xmlns:fo="http://www.w3.org/1999/XSL/Format"
  4. xmlns:fox="http://xml.apache.org/fop/extensions">
  5. <fo:layout-master-set>
  6. <fo:simple-page-master master-name="right"
  7. margin-top="75pt"
  8. margin-bottom="25pt"
  9. margin-left="100pt"
  10. margin-right="50pt">
  11. <fo:region-body margin-bottom="50pt"/>
  12. <fo:region-after extent="25pt"/>
  13. </fo:simple-page-master>
  14. <fo:simple-page-master master-name="left"
  15. margin-top="75pt"
  16. margin-bottom="25pt"
  17. margin-left="50pt"
  18. margin-right="100pt">
  19. <fo:region-body margin-bottom="50pt"/>
  20. <fo:region-after extent="25pt"/>
  21. </fo:simple-page-master>
  22. <fo:page-sequence-master master-name="psmOddEven" >
  23. <fo:repeatable-page-master-alternatives>
  24. <fo:conditional-page-master-reference master-reference="right"
  25. page-position="first" />
  26. <fo:conditional-page-master-reference master-reference="left"
  27. odd-or-even="even" />
  28. <fo:conditional-page-master-reference master-reference="right"
  29. odd-or-even="odd" />
  30. </fo:repeatable-page-master-alternatives>
  31. </fo:page-sequence-master>
  32. </fo:layout-master-set>
  33. <fo:page-sequence id="N2528" master-reference="psmOddEven">
  34. <fo:static-content flow-name="xsl-region-after">
  35. <fo:block text-align-last="center" font-size="10pt">
  36. <fo:page-number/>
  37. </fo:block>
  38. </fo:static-content>
  39. <fo:flow flow-name="xsl-region-body">
  40. <fo:block font-size="18pt" font-weight="bold">1. FOP test for images</fo:block>
  41. <fo:block id="N2531">
  42. <fo:block font-size="16pt" font-weight="bold" space-before.minimum="1em" space-before.optimum="1.5em" space-before.maximum="2em">A GIF image in FOP</fo:block>
  43. <fo:block>
  44. <fo:external-graphic src="../graphics/xml_feather.gif"/>
  45. </fo:block>
  46. </fo:block>
  47. <fo:block id="N2535">
  48. <fo:block font-size="16pt" font-weight="bold" space-before.minimum="1em" space-before.optimum="1.5em" space-before.maximum="2em">A transparent GIF image in FOP</fo:block>
  49. <fo:block>
  50. <fo:external-graphic src="../graphics/xml_feather_transparent.gif"/>
  51. </fo:block>
  52. </fo:block>
  53. <fo:block id="N2545">
  54. <fo:block font-size="16pt" font-weight="bold" space-before.minimum="1em" space-before.optimum="1.5em" space-before.maximum="2em">A JPEG image in FOP</fo:block>
  55. <fo:block>
  56. <fo:external-graphic src="../graphics/fop.jpg"/>
  57. </fo:block>
  58. </fo:block>
  59. <fo:block id="N2550">
  60. <fo:block font-size="16pt" font-weight="bold" space-before.minimum="1em" space-before.optimum="1.5em" space-before.maximum="2em">A BMP image in FOP</fo:block>
  61. <fo:block>
  62. <fo:external-graphic src="../graphics/linux.bmp"/>
  63. </fo:block>
  64. </fo:block>
  65. <fo:block id="N2555">
  66. <fo:block font-size="16pt" font-weight="bold" space-before.minimum="1em" space-before.optimum="1.5em" space-before.maximum="2em">A PNG image in FOP</fo:block>
  67. <fo:block>
  68. <fo:external-graphic src="../graphics/asf-logo.png"/>
  69. </fo:block>
  70. </fo:block>
  71. <fo:block id="N2556">
  72. <fo:block font-size="16pt" font-weight="bold" space-before.minimum="1em" space-before.optimum="1.5em" space-before.maximum="2em">A TIFF image in FOP</fo:block>
  73. <fo:block>
  74. <fo:external-graphic src="../graphics/asf-logo.tif"/>
  75. </fo:block>
  76. </fo:block>
  77. <fo:block id="N2559">
  78. <fo:block font-size="16pt" font-weight="bold" space-before.minimum="1em" space-before.optimum="1.5em" space-before.maximum="2em"/>
  79. This section is only required to show that the layout still works.
  80. </fo:block>
  81. </fo:flow>
  82. </fo:page-sequence>
  83. <fo:page-sequence id="N2561" master-reference="psmOddEven">
  84. <fo:static-content flow-name="xsl-region-after">
  85. <fo:block text-align-last="center" font-size="10pt">
  86. <fo:page-number/>
  87. </fo:block>
  88. </fo:static-content>
  89. <fo:flow flow-name="xsl-region-body" text-align="start" font-size="10pt">
  90. <fo:block id="e-g-use" font-size="18pt" font-weight="bold">A. The usage of fo:external-graphic</fo:block>
  91. <fo:block>
  92. <fo:block>The image used in these examples has the following properties:</fo:block>
  93. <fo:block start-indent="1cm">
  94. <fo:block>169 x 51 px, 96 dpi, results in an intrinsic size of 44.715 x 13.494 mm</fo:block>
  95. </fo:block>
  96. <fo:block>
  97. All the examples here will have a border="solid 0.1pt" to show the size of the viewport generated by the
  98. external-graphic element and a background-color="yellow" to show what parts of the viewport are painted
  99. upon by the image in the reference area. The image used is the non-transparent version of asf-logo.png:
  100. file:../graphics/asf-logo-nt.png (nt=non-transparent)
  101. </fo:block>
  102. <fo:block keep-with-next.within-column="always">Properties: [none]</fo:block>
  103. <fo:block><fo:external-graphic src="../graphics/asf-logo-nt.png" border="solid 0.1pt" background-color="yellow"/></fo:block>
  104. <fo:block keep-with-next.within-column="always">Properties: width="60mm" height="20mm"</fo:block>
  105. <fo:block><fo:external-graphic src="../graphics/asf-logo-nt.png" width="60mm" height="20mm" border="solid 0.1pt" background-color="yellow"/></fo:block>
  106. <fo:block keep-with-next.within-column="always">Properties: inline-progression-dimension="60mm" block-progression-dimension="20mm"</fo:block>
  107. <fo:block><fo:external-graphic src="../graphics/asf-logo-nt.png" inline-progression-dimension="60mm" block-progression-dimension="20mm" border="solid 0.1pt" background-color="yellow"/></fo:block>
  108. <fo:block keep-with-next.within-column="always">Properties: width="30mm" height="20mm"</fo:block>
  109. <fo:block><fo:external-graphic src="../graphics/asf-logo-nt.png" width="30mm" height="20mm" border="solid 0.1pt" background-color="yellow"/></fo:block>
  110. <fo:block keep-with-next.within-column="always">Properties: width="30mm" height="20mm" overflow="hidden"</fo:block>
  111. <fo:block><fo:external-graphic src="../graphics/asf-logo-nt.png" width="30mm" height="20mm" overflow="hidden" border="solid 0.1pt" background-color="yellow"/></fo:block>
  112. <fo:block keep-with-next.within-column="always">Properties: width="60mm" height="20mm" text-align="center" display-align="center"</fo:block>
  113. <fo:block><fo:external-graphic src="../graphics/asf-logo-nt.png" width="60mm" height="20mm" text-align="center" display-align="center" border="solid 0.1pt" background-color="yellow"/></fo:block>
  114. <fo:block keep-with-next.within-column="always">Properties: content-height="20mm"</fo:block>
  115. <fo:block><fo:external-graphic src="../graphics/asf-logo-nt.png" content-height="20mm" border="solid 0.1pt" background-color="yellow"/></fo:block>
  116. <fo:block keep-with-next.within-column="always">Properties: content-width="60mm" content-height="40mm"</fo:block>
  117. <fo:block><fo:external-graphic src="../graphics/asf-logo-nt.png" content-width="60mm" content-height="40mm" border="solid 0.1pt" background-color="yellow"/></fo:block>
  118. <fo:block keep-with-next.within-column="always">Properties: content-width="60mm" content-height="40mm" scaling="non-uniform"</fo:block>
  119. <fo:block><fo:external-graphic src="../graphics/asf-logo-nt.png" content-width="60mm" content-height="40mm" scaling="non-uniform" border="solid 0.1pt" background-color="yellow"/></fo:block>
  120. <fo:block keep-with-next.within-column="always">Properties: width="60mm" height="20mm" content-width="scale-to-fit"</fo:block>
  121. <fo:block><fo:external-graphic src="../graphics/asf-logo-nt.png" width="60mm" height="20mm" content-width="scale-to-fit" border="solid 0.1pt" background-color="yellow"/></fo:block>
  122. <fo:block keep-with-next.within-column="always">Properties: width="60mm" content-width="scale-to-fit"</fo:block>
  123. <fo:block><fo:external-graphic src="../graphics/asf-logo-nt.png" width="60mm" content-width="scale-to-fit" border="solid 0.1pt" background-color="yellow"/></fo:block>
  124. <fo:block break-before="page"/>
  125. <fo:block keep-with-next.within-column="always">Properties: width="100%" content-width="scale-to-fit"</fo:block>
  126. <fo:block><fo:external-graphic src="../graphics/asf-logo-nt.png" width="100%" content-width="scale-to-fit" border="solid 0.1pt" background-color="yellow"/></fo:block>
  127. <fo:block space-before="0.5em">
  128. The following example shows how to fit an oversized image into the
  129. available width, but not scale smaller images up. This is a work-around
  130. until "scale-down-to-fit" is supported. The second feather below is in
  131. a block-container with a width of 40mm to simulate an oversized image.
  132. </fo:block>
  133. <fo:block keep-with-next.within-column="always">Properties: width="100%" content-width="scale-to-fit" content-height="100%"</fo:block>
  134. <fo:block><fo:external-graphic src="../graphics/asf-logo-nt.png" width="100%" content-width="scale-to-fit" content-height="100%" border="solid 0.1pt" background-color="yellow"/></fo:block>
  135. <fo:block-container width="40mm" background-color="lightgray">
  136. <fo:block><fo:external-graphic src="../graphics/asf-logo-nt.png" width="100%" content-width="scale-to-fit" content-height="100%" border="solid 0.1pt" background-color="yellow"/></fo:block>
  137. </fo:block-container>
  138. </fo:block>
  139. </fo:flow>
  140. </fo:page-sequence>
  141. </fo:root>