Using barcodes on PDF forms
March 12, 2007
Nowadays traceability is very important, especially in some specific sectors: food, transport, distribution, etc. Thus the use of barcodes is common. In Openbravo implementations this need has been solved using Barcode4j. Barcode4j implements different barcode types: Code 39, Code 128, EAN-128, Codabar, UPC-A, EAN-13, EAN-8, …
In spite of the fact that it is possible to implement different barcode types, depending on the barcode type the implementation can be more complex.
It is not an object of this post to explain the Barcode4j functionality (examples), but I will show an EAN-128 example using XmlEngine on OpenbravoERP.
XML FILE:
<FIELD id=”fieldUpc” replaceCharacters=”fo” attribute=”message” replace=”xxzzz” default=”0038437005258001453″>upc</FIELD>
FO FILE:
<fo:block>
<fo:instream-foreign-object>
<bc:barcode xmlns:bc=”http://barcode4j.krysalis.org/ns” message=”xxzzz” render-mode=”svg” id=”fieldUpc”>
<bc:ean128>
<bc:quiet-zone>1cm</bc:quiet-zone>
<height>32mm</height>
<module-width>0.6mm</module-width>
<bc:human-readable>
<bc:omit-brackets>false</bc:omit-brackets>
</bc:human-readable>
</bc:ean128>
</bc:barcode>
</fo:instream-foreign-object>
</fo:block>
P.D: This example is implemented with FOP 0.20.5 and Barcode4j 1.0. As soon as we implement the example with FOP 0.92 and Barcode4j 2.0. we let you know.
Entry Filed under: Openbravo. .
Trackback this post | Subscribe to the comments via RSS Feed