I need to be able to generate an Barcode4J EAN13 or Code128 code bar with a certain color (forecolor). I have tried something like this:
<reportElement mode="Transparent" x="5" y="22" width="27" height="85" forecolor="#FF0033" uuid="5e10e200-d625-4d8e-8d7d-163136972d95">
<jr:EAN13 xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd" orientation="90" textPosition="bottom">
But (jasper reports 5.5.1) does not generate the bar code in the indicated color [forecolor="#FF0033"], but in black. Does anyone know if it is possible to generate color barcodes with Barcode4J and how it could be done?
It would be something similar to writing a certain arbitrary text in a certain color.
I just would try to wrap the Barbecue/Barcode4J rendering into an own ToolsClass e.g."MyColorBarcodeProducer" and use the public API of both barcode libraries to render the image by your own color (that you perhaps also could pass as a simple String parameter to the wrapper method)
As ImageExpression you could then use something like this:
The method just returns the image as PNG/SVG and Jasper renders it.
hth + regards