aboutsummaryrefslogtreecommitdiffstats
path: root/examples/fo/advanced/barcode.fo
blob: 155fc242161d92fa7cf2666fac1a094e7dbe120e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
<?xml version="1.0" encoding="ISO-8859-1"?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">

<fo:layout-master-set>
  <fo:simple-page-master master-name="first"
        page-width="21cm" 
        page-height="29.7cm"
        margin-top="5mm">
     <fo:region-body 
        margin-bottom="4.5in" 
        margin-right="5mm" 
        margin-left="5mm" 
        margin-top="5mm"/>
     <fo:region-after 
        extent="4in" />
  </fo:simple-page-master>

  <fo:simple-page-master master-name="rest"
        page-width="21cm" 
        page-height="29.7cm"  
        margin-right="5mm" 
        margin-left="5mm" 
        margin-top="5mm" 
        margin-bottom="5mm">
     <fo:region-body/>
  </fo:simple-page-master>
  
  <fo:page-sequence-master master-name="A4">
     <fo:repeatable-page-master-alternatives>
        <fo:conditional-page-master-reference master-reference="first" page-position="first"/>
        <fo:conditional-page-master-reference master-reference="rest" page-position="rest"/>
        <fo:conditional-page-master-reference master-reference="rest"/>
     </fo:repeatable-page-master-alternatives>
  </fo:page-sequence-master>
</fo:layout-master-set>
   
  <fo:page-sequence master-reference="A4">
    <fo:flow flow-name="xsl-region-body" font-size="12pt">

			<fo:block font-size="14pt" font-weight="bold">
			        Example embedding Font
			</fo:block>
			
			<fo:block>
			        This example shows how to use an embedded font and
			        uses a free barcode font as an example. The barcode font is from
			        <fo:basic-link external-destination="http://www.geocities.com/keith_dimmock/">http://www.geocities.com/keith_dimmock/</fo:basic-link>
			        and is free.
			</fo:block>
			
			<fo:block>
			  To generate the PDF from this example, set the following build parameters
			  (for example in build-local.properties) and run "build examples" from the
			  top-level FOP source code directory.
			  
			  <fo:block font-family="Courier" font-size="10pt" margin-left="2em">
			    <fo:block>fo.examples.dir = ./examples/fo/advanced</fo:block>
			    <fo:block>fo.examples.include = **/barcode.fo</fo:block>
			    <fo:block>fo.examples.userconfig =  examples/fo/advanced/bar.conf.xml</fo:block>
			    <fo:block>fo.examples.force = true</fo:block>
			  </fo:block>
			</fo:block>
			
			<fo:block>
			  If the character encoding is correct in the generated PDF (bugzilla 5335), searching for "123456" should 
			  find the first barcode, and "234567" the second.
			</fo:block>
			
			<fo:block font-weight="bold" space-before.optimum="2em">
				First barcode: *ID123456*
			</fo:block>
			
			<fo:block 
			  font-family="Barcode" 
			  font-size="74pt">
				*ID123456*
			</fo:block>
			
			<fo:block>
				normal text, follows first barcode.
			</fo:block>
			
			<fo:block font-weight="bold" space-before.optimum="2em">
				Second barcode: *ID234567* and some text
			</fo:block>
			
			<fo:block 
			  font-family="Barcode, Helvetica" 
			  font-size="74pt">
			  *ID234567* and some text
			</fo:block>

			<fo:block>
				normal text, follows second barcode.
			</fo:block>
			
    </fo:flow>
   </fo:page-sequence>
</fo:root>