SVG Stylesheet library from RenderX
We are pleased to announce that RenderX have recently released a library of XSLT stylesheets that produce SVG representation of the following barcode formats:
Our generators support the full range of barcode properties including checksum generation (except for Codabar). All stylesheets are heavily parameterized: you can control bars width/height, wide-to-narrow ratio, quiet zone size, font properties for human readable label, etc.
RenderX barcode library is freely available at RenderX.com
On the same page you will also find a simple online demo for each supported barcode type - the SVG image generated by a stylesheet is inserted into an XSL FO wrapper and rendered to PDF by RenderX XEP formatter. The online demo is limited to the basic flavor of the respective barcode. To assess the full power of the stylesheets, download them and try offline.
We believe that these utilities may be of interest for SVG and XSLT communities - either as a sample of implementation of complex logic in an XSLT, or as a demonstration of dynamically generated SVG applied to everyday business needs.
Barcode generator in XSL
We have an XSL stylesheet that draws barcodes from digit sequences. We hope a thing like this may be useful for people wishing to add barcode labelling to their XSL-based publishing solutions;
It is also a funny example of XSLT programming per se.
Barcodes implemented are the most popular ones that you can see on items in stores and groceries - UPC/EAN, to be precise; other systems can be easily added. The output is an XSL FO table that can be rendered to PDF. As most of the barcode-drawing logic is independent of the output graphical format, modifying the stylesheet to produce SVG or something similar should be a relatively simple task.
The stylesheet and examples are freely available from Renderx;
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.:
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.
Barcode generator code
Krysalis Barcode is a barcode generation package written in Java and available under The Krysalis Patchy Software License (which is based on the Apache Software License Version 1.1).
1D barcode implementations:
Support for multiple output formats:
For more information about Krysalis Barcode, please visit: krysalis.org