Home arrow FAQs arrow 2-D Barcodes FAQ
2-D Barcodes FAQ Print E-mail
Is it possible to encode binary data with your DataMatrix (PDF417) barcodes?

Why do I get some other information while scanning and not the information I encoded with your DataMatrix (PDF417) control?

Your DataMatrix barcode ActiveX control accepts a string as the barcode value (DataMatrixCtrl1.DataToEncode). But our original barcode value is presented by an array of bytes. How should I convert our bytes' array into to the corresponding string if I want to use your component?





Is it possible to encode binary data with your DataMatrix (PDF417) barcodes?

Yes, it is. To encode binary data, you should convert each byte into the following form:

~xNN

where NN is your binary number.
Suppose you need to encode the following byte array:

0000C7A9030030323141642343001D2774

You should convert it into the following string:

"~x00~x00~xC7~xA9~x03~x00~x30~x32~x31~x41~x64~x23~x43~x00~x1D~x27~x74"

This string must be attributed to the DataToEncode property. Our DataMatrix (PDF417) will decode this string and your real barcode will have your initial byte array in it instead of the string.




Why do I get some other information while scanning and not the information I encoded with your DataMatrix (PDF417) control?

For example, I tried to create a datamatrix Base256 barcode using the Hex data. This is my hex data.

0000C7A9030030323141642343001D2774

I converted it to this.

~x00~x00~xC7~xA9~x03~x00~x30~x32~x31~x41~x64~x23~x43~x00~x1D~x27~x74

When I scanned the data, I did not get my original hex data. I got this.

44454D4F0000C7A9030030323141642343001D2774

What am I doing wrong ? I used the VB sample project.


As you can see, only first four bytes do not coincide, the rest of the code is completely the same. It happens because you use the demo version. The first four bytes 44454D4F mean the "DEMO" string in the HEX representation.

Note: The "DEMO" string can be added not only at the beginning of your barcode, but also at the end of it. In this case these four bytes will be at the end of your binary data:

0000C7A9030030323141642343001D277444454D4F





Your DataMatrix barcode ActiveX control accepts a string as the barcode value (DataMatrixCtrl1.DataToEncode). But our original barcode value is presented by an array of bytes. How should I convert our bytes' array into to the corresponding string if I want to use your component?

Yes, you are right. The data to be encoded must be represented in the form of a string and it is impossible to represent binary data in a string. That is why to encode binary data, you should convert each byte into the following form:

~xNN

where NN is your binary number.

See also

Is it possible to encode binary data with your DataMatrix (PDF417) barcodes?
Why do I get some other information while scanning and not the information I encoded with your DataMatrix (PDF417) control?


 

Copyright (c) 1999-2013, VBC Software. All rights reserved.
All trademarks mentioned are the property of their respective owners