Barcodes are simple to represent as black
rectangles separated by white spaces, but they have proved to be
difficult to generate accurately. Bar and space widths are often
computed in a complex manner and check digits complicate the picture.
Our approach uses XSLT to implement the computational part and SVG
to draw the image. Using this technique, it becomes possible to
integrate barcodes into XSL-based workflows in a natural way.
The following barcode types are available:
UPC/EAN
Code 3 of 9
Code 2 of 5 (i)
Code 128
Codabar
AU Post
Barcode generation templates can be called directly from within
XSL stylesheets with no need for special barcode fonts or third-party
image-drawing software. Compared to other methods of producing bar
codes in XSL FO, this technique has obvious advantages:
printed output is the sharpest possible since
it is a vector graphics;
image size is reduced;
every aspect of the barcode pattern can be controlled - stroke widths,
colors, lengths, etc.