Reputation: 37
I am using iText for java. I am trying to create a Code128 barcode with a FNC3 character at the beginning of the barcode. Can anyone help me with this? Here is my code:
try {
Barcode128 barcode = new Barcode128();
barcode.setCode((char)228 + "92");
Image img = barcode.createAwtImage(Color.black, Color.white);
lblBarcode.setIcon(new ImageIcon(img));
}
catch(Exception ex) {
ex.printStackTrace();
}
Upvotes: 2
Views: 3112
Reputation: 3650
To have a code that starts with FNC3 use barcode.setCode(""+FNC3+<rest of barcode>)
. The FNC3
constant is located in com.itextpdf.text.pdf.Barcode
Upvotes: 1