Quantcast

Datamatrix DM_Extension FNC1 variable length GS1 element

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Datamatrix DM_Extension FNC1 variable length GS1 element

luc1291
Hi
Im using the Option DM_EXTENSION for GS1 (Code 128 based) 2D Datamatrix Barcodes. That works perfectly as long as I am only using not more then one GS1 element of variable length. Just placed the variable length element at the end of the 'text' and all is good.
Im using:
com.itextpdf.text.pdf.BarcodeDatamatrix.setOptions(int options)
for setting the DM_EXTENSION
and
com.itextpdf.text.pdf.BarcodeDatamatrix.generate(String text) throws UnsupportedEncodingException
for generating the code

Working sample:
String text input data:
 f.010764016651024611150819100000001422
->
GTIN(01) = 07640166510246
ProdDate(11) = 150819
Charge(10) = 0000001422
Charge is of variable length.

My question. How can I build a barcode with to variable length GS1 elements? There needs to be a Group Separator tag (according Standard it is FNC1 (ASCII 232)).
How is this done?

It seems all after the . is taken as code and any attempts of placing a group separator like <FNC1> or ASCII Code 232, etc fails. It is always interpreted as part of the previous element.

Problem sample, Charge and Serialnumber (S/N) are of variable length:
Input data f.010764016651024611150819100000001422210001782387
-> should be
GTIN(01) = 07640166510246
ProdDate(11) = 150819
Charge(10) = 0000001422
S/N = 0001782387

but barcode reader shows
GTIN(01) = 07640166510246
ProdDate(11) = 150819
Charge(10) = 0000001422210001782387
so S/N and code of it is part of Charge

as mentioned above if I try to place a group separator e.g like this
Input data f.010764016651024611150819100000001422<FNC1>210001782387
->
barcode reader shows
GTIN(01) = 07640166510246
ProdDate(11) = 150819
Charge(10) = 0000001422<FNC1>210001782387
an notes that there is an error in the code

Thanks for any suggestions how to tell the BarcodeDatamatrix.generate that there is a group separator and not only code (text)
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Datamatrix DM_Extension FNC1 variable length GS1 element

luc1291
Hi
I found a way. Not as nice and handy as I liked but it works.
Anyway, the solution is that the FNC1 group separator code needs to be placed with unicode
\u001d
this is the information/group separator GS (hex 1d, ascii 29) 'character'



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Datamatrix DM_Extension FNC1 variable length GS1 element

Srinu
This post has NOT been accepted by the mailing list yet.
This post was updated on .
Hi
I am generating GS1 DataMatrix Barcode. Though barcode is generated properly, it is not scanned. Could anybody let me know where would be problem in my code.

document.open();
BarcodeDatamatrix datamatrix = new BarcodeDatamatrix();
datamatrix.setOptions(BarcodeDatamatrix.DM_EXTENSION);
datamatrix.generate("f.101234514222112341782387");//(10)123451422   (21)12341782387
com.itextpdf.text.Image image = datamatrix.createImage();
document.add(image);
document.close();

Thanks,
Srinu
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Datamatrix DM_Extension FNC1 variable length GS1 element

blowagie
This post has NOT been accepted by the mailing list yet.
Do you see the message "This post has NOT been accepted by the mailing list yet."

That means that nobody is looking at your question. The mailing list has been discontinued and Nabble is not the official support channel. Please take a look at http://itextpdf.com/support to find out where to ask questions.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Datamatrix DM_Extension FNC1 variable length GS1 element

luc1291
In reply to this post by luc1291

Hi gopinethi

sample:
you need the code for eg.
(01)07640166510246 (11)150819 (10)0000001422 (21)00176327

the string for the datamatrix.generate(string) needs to contain \u001d for the <FNC1> separators.
I got the string from an other source and agreed with them that there the <FNC1> separators are placed with the agreed 'tag' like eg. #FNC1# so the string looks like this:
f.010764016651024611150819100000001422#FNC1#2100176327
this (or multiple) #FNC1# is now simply replace (with java string.replace) with \u001d eg:
newstring = inputstring.replace("#FNC1#", "\u001d")
then
datamatrix.generate(newstring)
this will now generate the correct code

hope that helps

Loading...