PDA

View Full Version : Barcode Support



judy.zhu
11-09-2010, 05:19 PM
Hi there,

I have a question regarding unsupported barcodes. Some of our customers use barcodes that are not supported by the simple barcodes in Pentaho (eg, data matrix). We used to use Stimulsoft for report printing and the way we deal with the same problem in Stimulsoft is that we install a special chip in the physical printer. The chip has a firmware installed on it and given a printer-specific control sequence, it is able to print the barcode as required. Then from Stimulsoft, we invoke a native method that is able to send the control sequence.

Is Pentaho able to do the same thing? ie, does it also have a native method or some other special commands that allow us to talk to the printer directly?

Also, if I install the ttf files myself, is it going to work?

Many thanks,
Judy

Taqua
11-09-2010, 06:10 PM
We do not support to include non-standard codes in the printing output, as printing is done by the Java system and translated to the printer drivers own language by some magical (operating system dependent) means. And implanting a chip sounds weird too. We are not borg here :)

If I would have to print data-matrix codes today, I would go and write the necessary glue code to fit in Barcode4J into the system. Heck, I might do that for the 4.0 release or just as a optional sideline item anyway - as it is easy and our current "Barbecue" barcode library seems to be a dead project.

judy.zhu
11-09-2010, 06:59 PM
Thanks for your help Taqua :)

Could you please explain more on the "necessary glue code to fit in Barcode4J into the system"? I'm a bit confused here. Is pentaho using Barcode4J? What do I need to write this glue code? And if I do write this code, would I be able to inject it into Pentaho and use it the same way as the supported barcodes?

Thanks,
Judy

judy.zhu
11-14-2010, 11:07 PM
Does anyone have any idea? How do I inject Barcode4J into the system? If it doesn't work, could I use a ttf file? Please help... If we can't get this to work, we have to use another tool, like switching back to Stimulsoft...

Many thanks,
Judy

Taqua
11-24-2010, 01:25 PM
Barcode4J is a java library. You will have to write JavaCode. You have two options: Either let Barcode4J generate a java.awt.Image for you (produces a raster image which looks bad on printing) or implement a Drawable implementation that then calls the Barcode4J Graphics2D outputter to render the image into a Graphics2D context.

That is the core code.

Then you may want to add additional code so that you get a "Barcode4J" element in the report designer with properly declared attributes and styles so that you can define that barcode element graphically. For that: Look at the SimpleBarcodeElement code in the pentaho-reporting-engine-classic-extensions module. This module contains the code for talking to "Barbecue" - a alternative Barcode provider. It should be rather trivial to adapt that code to use Barcode4J instead.

I took the liberty to actually create a JIRA case for that issue. http://jira.pentaho.com/browse/PRD-3088

For the future remember: If none of our users thinks the problem is important enough to create a JIRA case, then we (safely) assume it is not important for them to ask for a fix for it. In that cases we simply provide no fix, as there are hundreds of cases that are open and where people are passionate about it.