From: Matej H. <mat...@gm...> - 2012-02-27 19:25:01
|
Hello, I have just discovered this great project and I have one question. I am using barcode4j with Apache FOP. When I run transformation, I get PDF with barcode, but "human readeable" part is missing (in place where there should be numbers, everything is empty). I am using Apache FOP 1.0 + barcode4j.jar + barcode4j-fop-ext.jar version 2.1 (running from ORACLE database version 10.2.0.1.0 - java 1.4.2_04). XML: <?xml version="1.0"?> <example> <heading>Hello, barcode world!</heading> <barcode>123456789012</barcode> </example> XSL: <?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"> <xsl:output method="xml"/> <xsl:template match="example"> <fo:root> <fo:layout-master-set> <fo:simple-page-master master-name="page"> <fo:region-body region-name="body" margin-top="0.5in" margin-bottom="1in" margin-left="0.5in" margin-right="0.5in" background-image="watermark.png" background-repeat="no-repeat" background-position-horizontal="left" background-position-vertical="top"/> /> </fo:simple-page-master> </fo:layout-master-set> <fo:page-sequence master-reference="page"> <fo:flow flow-name="body"> <fo:block font-size="18pt" margin="0.5cm"> <xsl:value-of select="heading"/> </fo:block> <fo:block margin-top="2.4cm" margin-left="3cm"> <xsl:apply-templates select="barcode"/> </fo:block> </fo:flow> </fo:page-sequence> </fo:root> </xsl:template> <xsl:template match="barcode"> <xsl:variable name="message" select="."/> <fo:instream-foreign-object> <barcode:barcode xmlns:barcode="http://barcode4j.krysalis.org/ns" message="{$message}"> <barcode:ean-13> <barcode:height>15mm</barcode:height> </barcode:ean-13> </barcode:barcode> </fo:instream-foreign-object> </xsl:template> </xsl:stylesheet> RESULT: Yours sincerely, Matej Hlastec |