您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

barcode.fo 3.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. <?xml version="1.0" encoding="ISO-8859-1"?>
  2. <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
  3. <fo:layout-master-set>
  4. <fo:simple-page-master master-name="first"
  5. page-width="21cm"
  6. page-height="29.7cm"
  7. margin-top="5mm">
  8. <fo:region-body
  9. margin-bottom="4.5in"
  10. margin-right="5mm"
  11. margin-left="5mm"
  12. margin-top="5mm"/>
  13. <fo:region-after
  14. extent="4in" />
  15. </fo:simple-page-master>
  16. <fo:simple-page-master master-name="rest"
  17. page-width="21cm"
  18. page-height="29.7cm"
  19. margin-right="5mm"
  20. margin-left="5mm"
  21. margin-top="5mm"
  22. margin-bottom="5mm">
  23. <fo:region-body/>
  24. </fo:simple-page-master>
  25. <fo:page-sequence-master master-name="A4">
  26. <fo:repeatable-page-master-alternatives>
  27. <fo:conditional-page-master-reference master-reference="first" page-position="first"/>
  28. <fo:conditional-page-master-reference master-reference="rest" page-position="rest"/>
  29. <fo:conditional-page-master-reference master-reference="rest"/>
  30. </fo:repeatable-page-master-alternatives>
  31. </fo:page-sequence-master>
  32. </fo:layout-master-set>
  33. <fo:page-sequence master-reference="A4">
  34. <fo:flow flow-name="xsl-region-body" font-size="12pt">
  35. <fo:block font-size="14pt" font-weight="bold">
  36. Example embedding Font
  37. </fo:block>
  38. <fo:block>
  39. This example shows how to use an embedded font and
  40. uses a free barcode font as an example. The barcode font is from
  41. <fo:basic-link external-destination="http://www.geocities.com/keith_dimmock/">http://www.geocities.com/keith_dimmock/</fo:basic-link>
  42. and is free.
  43. </fo:block>
  44. <fo:block>
  45. To generate the PDF from this example, set the following build parameters
  46. (for example in build-local.properties) and run "build examples" from the
  47. top-level FOP source code directory.
  48. <fo:block font-family="Courier" font-size="10pt" margin-left="2em">
  49. <fo:block>fo.examples.dir = ./examples/fo/advanced</fo:block>
  50. <fo:block>fo.examples.include = **/barcode.fo</fo:block>
  51. <fo:block>fo.examples.userconfig = examples/fo/advanced/bar.conf.xml</fo:block>
  52. <fo:block>fo.examples.force = true</fo:block>
  53. </fo:block>
  54. </fo:block>
  55. <fo:block>
  56. If the character encoding is correct in the generated PDF (bugzilla 5335), searching for "123456" should
  57. find the first barcode, and "234567" the second.
  58. </fo:block>
  59. <fo:block font-weight="bold" space-before.optimum="2em">
  60. First barcode: *ID123456*
  61. </fo:block>
  62. <fo:block
  63. font-family="Barcode"
  64. font-size="74pt">
  65. *ID123456*
  66. </fo:block>
  67. <fo:block>
  68. normal text, follows first barcode.
  69. </fo:block>
  70. <fo:block font-weight="bold" space-before.optimum="2em">
  71. Second barcode: *ID234567* and some text
  72. </fo:block>
  73. <fo:block
  74. font-family="Barcode, Helvetica"
  75. font-size="74pt">
  76. *ID234567* and some text
  77. </fo:block>
  78. <fo:block>
  79. normal text, follows second barcode.
  80. </fo:block>
  81. </fo:flow>
  82. </fo:page-sequence>
  83. </fo:root>