Re: [xsl] Integrating barcode in xsl:fo

Subject: Re: [xsl] Integrating barcode in xsl:fo
From: "W. Eliot Kimber" <eliot@xxxxxxxxxx>
Date: Thu, 04 Sep 2003 21:17:47 -0500
Abhijit Junnare wrote:
I want to use barcode with xsl:fo. I downloaded the
krysalis barocde application but cannot run it. Has
anyone used something to generate barcodes to be
printed in the pdf file using xsl or xsl:fo ?
Any help is appreciated.

There are a number of vendors that provide bar codefonts. Do a google search on "barcode fonts" and you'll find them. Several provide free trials.

Some barcode schemes do not use a check sum, the most common being "code 39". For these barcodes you just set the font and use normal numbers, e.g.:

<fo:block font-family="Code39Demo">1234567</fo:block>

Code39Demo is one font I found--don't have the source to hand.

For other barcode schemes, you have to calculate the checksum or include it in the data, which you normally wouldn't do. You can do this calculation in XSLT but it's non-trivial (easier with exslt functions or you could write an extension function).

RenderX has a sample of using XSLT and pure FO to generate graphical bar codes, but this seems like more work than just using a font. But it does make for a neat parlor trick.


W. Eliot Kimber, eliot@xxxxxxxxxx
Consultant, ISOGEN International

1016 La Posada Dr., Suite 240
Austin, TX  78752 Phone: 512.656.4139

XSL-List info and archive:

Current Thread