We are facing a problem when using Aspose.BarCode for Java.
When we print the generated barcode, the background color is not totally white, but a little grey. It is not always the case, it depends on the printer we use.
It is a problem since it is not easy to decode a barcode with a grey background.
We try to put a transparent backcolor, but it seems that it doesn’t work, the backColor is always white, not transparent.
Here is the code we use to activate this transparent color :
BarCodeBuilder b = new BarCodeBuilder();
…
b.setBackColor(new Color (255, 255, 255, 0));
b.setForeColor(Color.BLACK);
…
Have you got an idea to solve our problem?
This message was posted using Email2Forum by sheliah.
Yes, it is a problem with the printer, white background are grey when printing. The only way to obtain a white background with this printer is to print a PNG image with a transparent background.
So my question is : Is it possible to generate a barcode with a transparent background using Aspose?
To print the barcode, we include it to a pdf file (using jasper) and then, we print the pdf.
Hi, sorry for the delay, i had a training period last week.
I’ve tried your solution but the generated barcode background was totally black, not transparent.
I’ve tried some other solutions : - b.setBackColor(new Color(10,100,150)); => background color is blue - b.setBackColor(new Color(10,100,150,255)); => exactly the same color (blue), 255 means full opaque, so this is working. - b.setBackColor(new Color(10,100,150,0)); 0 means full transparent ==> background color is totally black and opaque
It seems that you can’t generate a transparent background color barcode with Aspose…