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.

simple.fo 4.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <!-- example for a simple fo file. At the beginning the page layout is set.
  3. Below fo:root there is always
  4. - a single fo:layout-master-set which defines one or more page layouts
  5. - an optional fo:declarations
  6. - and a sequence of one or more fo:page-sequences containing the text and formatting instructions
  7. -->
  8. <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
  9. <fo:layout-master-set>
  10. <!-- fo:layout-master-set defines in its children the page layout:
  11. the pagination and layout specifications
  12. - page-masters: have the role of describing the intended subdivisions
  13. of a page and the geometry of these subdivisions
  14. In this case there is only a simple-page-master which defines the
  15. layout for all pages of the text
  16. -->
  17. <!-- layout information -->
  18. <fo:simple-page-master master-name="simple"
  19. page-height="29.7cm"
  20. page-width="21cm"
  21. margin-top="1cm"
  22. margin-bottom="2cm"
  23. margin-left="2.5cm"
  24. margin-right="2.5cm">
  25. <fo:region-body margin-top="3cm"/>
  26. <fo:region-before extent="3cm"/>
  27. <fo:region-after extent="1.5cm"/>
  28. </fo:simple-page-master>
  29. </fo:layout-master-set>
  30. <!-- end: defines page layout -->
  31. <!-- start page-sequence
  32. here comes the text (contained in flow objects)
  33. the page-sequence can contain different fo:flows
  34. the attribute value of master-name refers to the page layout
  35. which is to be used to layout the text contained in this
  36. page-sequence-->
  37. <fo:page-sequence master-reference="simple">
  38. <!-- start fo:flow
  39. each flow is targeted
  40. at one (and only one) of the following:
  41. xsl-region-body (usually: normal text)
  42. xsl-region-before (usually: header)
  43. xsl-region-after (usually: footer)
  44. xsl-region-start (usually: left margin)
  45. xsl-region-end (usually: right margin)
  46. ['usually' applies here to languages with left-right and top-down
  47. writing direction like English]
  48. in this case there is only one target: xsl-region-body
  49. -->
  50. <fo:flow flow-name="xsl-region-body">
  51. <!-- each paragraph is encapsulated in a block element
  52. the attributes of the block define
  53. font-family and size, line-heigth etc. -->
  54. <!-- this defines a title -->
  55. <fo:block font-size="18pt"
  56. font-family="sans-serif"
  57. line-height="24pt"
  58. space-after.optimum="15pt"
  59. background-color="blue"
  60. color="white"
  61. text-align="center"
  62. padding-top="3pt">
  63. Extensible Markup Language (XML) 1.0
  64. </fo:block>
  65. <!-- this defines normal text -->
  66. <fo:block font-size="12pt"
  67. font-family="sans-serif"
  68. line-height="15pt"
  69. space-after.optimum="3pt"
  70. text-align="justify">
  71. The Extensible Markup Language (XML) is a subset of SGML that is completely described in this document. Its goal is to
  72. enable generic SGML to be served, received, and processed on the Web in the way that is now possible with HTML. XML
  73. has been designed for ease of implementation and for interoperability with both SGML and HTML.
  74. </fo:block>
  75. <!-- this defines normal text -->
  76. <fo:block font-size="12pt"
  77. font-family="sans-serif"
  78. line-height="15pt"
  79. space-after.optimum="3pt"
  80. text-align="justify">
  81. The Extensible Markup Language (XML) is a subset of SGML that is completely described in this document. Its goal is to
  82. enable generic SGML to be served, received, and processed on the Web in the way that is now possible with HTML. XML
  83. has been designed for ease of implementation and for interoperability with both SGML and HTML.
  84. </fo:block>
  85. </fo:flow> <!-- closes the flow element-->
  86. </fo:page-sequence> <!-- closes the page-sequence -->
  87. </fo:root>