-
Notifications
You must be signed in to change notification settings - Fork 9
Home
CGantert345 edited this page Jun 9, 2022
·
11 revisions
The UIC barcode project provides a library to encode and decode the bar code content of bar codes according to the UIC IRS 90918-9 and the EU TAP-TSI TD B.12.
IRS 90918-9 specifies two different types of header frames, the Static Frame and the Dynamic Frame. Both are supported by the library.
The writing of the bar code is out of scope of the library as there are other solutions available:
e.g. ZXing:
String contents = new String(content,StandardCharsets.ISO_8859_1);
AztecWriter aztecWriter = new AztecWriter();
HashMap<EncodeHintType,Object> hints = new HashMap<EncodeHintType,Object>();
hints.put(EncodeHintType.ERROR_CORRECTION,Integer.toString(errorBits));
BitMatrix bitMatrix = aztecWriter.encode(contents, BarcodeFormat.AZTEC, 100, 100, hints);
if (bitMatrix == null) return null;
return MatrixToImageWriter.toBufferedImage(bitMatrix);