Good morning, friends!
I have a problem when passing the String with the barcode in the BarcodeInter25 parameter, In this code it is working but if I pass "23797685200000345000280090000014189301107610" it generates an Exception from java.lang.IllegalArgumentException: The text length must be even.
And I have already looked for several types and I do not think the ideal, since my project needs to generate a barcode for banking booth with 44 positions of the ITF format.
public static void main(String[] args) {
Document document = new Document(PageSize.A4, 50, 50, 50, 50);
try {
PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream("d:\BarcodesInter25.pdf"));
document.open();
PdfContentByte cb = writer.getDirectContent();
BarcodeInter25 code25 = new BarcodeInter25();
code25.setGenerateChecksum(true);
code25.setCode("99-1234567890-001");
Image image25 = code25.createImageWithBarcode(cb, null, null);
document.add(new Phrase(new Chunk(image25, 0, 0)));
}
catch (Exception de) {
de.printStackTrace();
}
document.close();
}
Thank you!