As GS1 Spec the DataBar Expanded should be support up to 74 number. Capacity: Maximum 74 Numeric/ 41 alphabetic
but your API can not generate barcode for the below GTIN String GTIN1 = “(01)00766907146318(11)991020(13)991022(17)201112(21)12345678901234567890(10)12345678901234567890”;
// Generate and save the image to file
BarCodeBuilder builder = new BarCodeBuilder();
// Set code text
builder.setCodeText(GTIN1);
// Set Symbology type
builder.setEncodeType(EncodeTypes.DATABAR_EXPANDED);
builder.setGraphicsUnit(GraphicsUnit.Millimeter);
builder.setAutoSize(true);
builder.setxDimension(xdim);
builder.setBarHeight(36.95f);
try {
builder.save("c:\\temp\\" + col + "_" + xdim *1000 + ".svg", BarCodeImageFormat.Svg);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Can you please double check if this information is correct? I was not able to find any online converter which allows this length - all of them were throwing the same exception. Can you please share if any barcode generator allows this length?
Sorry, it was not about length. The GTIN shared in your first post does not look correct because it is not being accepted by any online barcode generator. Can you please share if you are able to generate a barcode using this GTIN with any barcode builder?
I was able to generate the barcode using the sample GTIN shared at gs1.org and even expanding it to 74 number.
Can you provide me the length limitation for the databar expanded and databar expanded stacked now ? so i can add the restriction on UI (not break the API).
You can notice that the first one has a length of 74 numbers. The supported length is same as mentioned on your shared link (gs1.org) - you can put restrictions accordingly.
Another thing is that GS1 standard is very complicated as can be seen from its 455 pages specifications.
A short explanation about AI coding is as follow:
String with parentheses is only for human reading. Barcodes contain “internal” data with FNC symbols.
For example:
(01)00766907146318(10)123(21)1234567 (length is 36)
converts to <FNC1>010076690714631810123<FNC1>211234567 (length is 32)
where <FNC1> is 1 special character and the capacity limit affects only FNC-string.