Re: barcode4J

Jeremias Maerki <[email protected]> Wed, 18 Aug 2004 09:35:43 +0200
Newsgroups gmane.comp.krysalis.user
Message-ID <[email protected]>
Salut Philippe

On 18.08.2004 08:52:05 Philippe PITHON wrote:
> I use barcode4J with FOP and  I have 2 questions :
> 
> - with render FOP, how to rotate a bar-code?

Using the FOP extension, this is currently not possible. If you want to
rotate the barcode you will have to create the barcode during XSLT-stage
using the Xalan extension and then rotate it using an SVG wrapper like
the one you will find in examples/xsl-fo/barcodes2xsl-fo.xsl.

http://cvs.sourceforge.net/viewcvs.py/barcode4j/barcode4j/examples/xsl-fo/barcodes2xsl-fo.xsl?rev=1.1&view=auto

> - with Xalan -> HTML, how to generate files bar-code ?
> 
> Xalan generates file HTML (with XML+XSL) but I would like that it
> generates me also files bar-code (.jpg)
> 
> In page HTML, there would be links to the generated files bar-code
> where to modify the name of the file "jpg" code bars?

Using a barcode servlet. There's a servlet ready for use in Barcode4J. In
the XSLT for the HTML file you include an image reference with an URL
that calls the barcode servlet.

http://barcode4j.krysalis.org/servlet.html

Example:
<img src="http://localhost/barcode4j/gensvg?type=code128&msg=Barcode&fmt=gif&ext=.gif">

See also:
http://xml.apache.org/fop/servlets.html#ie

If I were you I wouldn't use JPEG for the barcode because it's a lossy
format and therefore it will cost you contrast which makes it harded for
a barcode reader to read correctly. Use GIF or PNG. These formats will
also be smaller in case of monochrome barcodes.

I hope that helps.

Jeremias Maerki



-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285