How to force C40 encoding for DataMatrix

752 views
Skip to first unread message

Champomix

unread,
Oct 23, 2018, 6:19:10 PM10/23/18
to zxing
Hello,

Is there a simple way to force the ZXing datamatrix writer to only use C40 text encoding ?

I want to encode this sequence :

DC02FR000001FFFF125E0330M EXEMPLE HENRY ET MME SPECIMEN NATACHA<GS>31FR7030002005500000157845Z02<GS>32CRLYFRPP<GS><US>Q2GMHTISR6UVVYAN5HT4KERASWGSCUVCJIDTAXLJQQ6XNC4OTMXDNXYTTRVPY3CMQDZEKFXOLUQAKVUYGTA3IPZGT5ZHU5OTB4QMQFA

with : <GS> equals to ASCII 29 and <US> to ASCII 31

in attachment the code i use to generate the barcode (ZXingDataMatrix.java)

The datamatrix barcode generated pattern (matrix.png) is different from the one i expect wich is text-encoded with C40 (orig.png).

Is there a way to indicate the DataMatrixWriter or its HighLevelEncoder.encodeHighLevel to only use C40 text-encoding ?

Thank you in advance for your precious help.

I use the ZXing version 3.3.3

matrix.png
orig.png
ZXingDataMatrix.java

Sean Owen

unread,
Oct 27, 2018, 3:16:09 PM10/27/18
to zxing
I don't think so, because the DM code itself should be dictating when to switch to what encoding. Is the DM code correct? you can always hack the source code to never switch modes and always start in C40, I guess.

Champomix

unread,
Oct 28, 2018, 1:02:25 PM10/28/18
to zxing
Le samedi 27 octobre 2018 21:16:09 UTC+2, Sean Owen a écrit :
> I don't think so, because the DM code itself should be dictating when to switch to what encoding. Is the DM code correct? you can always hack the source code to never switch modes and always start in C40, I guess.

Yes the DM is correct but the datamatrix shema is different from the one i would the expect. Actually from the 2D-DOC spcification from the French Government (https://ants.gouv.fr/Les-solutions/2D-Doc).

I tryed to hack the code ... but the matrix i create is not readable. I missed something but don't know what.

Is someone may share a code example, it would be very helpfull for me :)

Reply all
Reply to author
Forward
0 new messages