|
From: Frank D. <Fra...@ci...> - 2011-12-08 11:42:43
|
Hi,
I've got Barcode4J working from the command line but am having
difficulty getting it to work in Cocoon. The version of FOP that I'm
using is 0.25.5 so I've added barcode4J.jar,
barcode4J-fop-ext-0.20.5-complete.jar and the Avalon Framework jar file
to the classpath. Would someone mind looking at the files below and
tell me what I need to do to get the barcode to appear.
Thanks,
Frank
Below is my xml file
<?xml version="1.0"?>
<example>
<heading>Hello, barcode world!</heading>
<barcode>123456789012</barcode>
</example>
And here is my stylesheet
<?xml version="1.0"?>
<xsl:stylesheet
version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:barcode="http://barcode4j.krysalis.org/ns">
<xsl:template match="example">
<fo:root>
<fo:layout-master-set>
<fo:simple-page-master
master-name="page">
<fo:region-body
margin-top="0.5in"
margin-bottom="1in"
margin-left="0.5in"
margin-right="0.5in"
/>
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="page">
<fo:flow flow-name="xsl-region-body">
<fo:block>
<xsl:value-of select="heading"/> <xsl:value-of select="barcode"/>
</fo:block>
<fo:block>
into block
<fo:instream-foreign-object>
<barcode:barcode
message="my message">
<barcode:code128>
<barcode:height>8mm</barcode:height>
</barcode:code128>
</barcode:barcode>
</fo:instream-foreign-object>
</fo:block>
</fo:flow>
</fo:page-sequence>
</fo:root>
</xsl:template>
</xsl:stylesheet>
|