I'm tryi开发者_Go百科ng to create an application that generates PDF417 barcodes. To do this I'm following this guide: http://grandzebu.net/informatique/codbar-en/pdf417.htm
I'm generating the data codewords just fine, but when I use the algorithm to generate the error correction the result doesn't seem to be working fine, and I think the problem is the data that I'm passing to it.
The basic test I'm trying is generating a Pdf417 barcode with the data: Hello world
I'm using the byte-mode encoding.
The barcode being generated has 3 rows and 5 data columns.
The data codewords I use to generate the correction code words are these:
[901, 121, 291, 257, 858, 232, 119, 111, 114, 108, 100]
When I generate a barcode with the same data using a paid library, the correction codewords (using an error-correction level of 0) are these: [821, 305]
But when I generate the barcode using my algorithm, the correction codewords I get are [791, 594].
I also tried using the algorithm found here: http://sourceforge.net/projects/pdf417lib/, and the results are the same as with my algorithm.
Any idea on what am I doing wrong?
Thanks a lot for your time.
You will need 15 word in total for 5 columns and 3 rows. Because you are using error correction level zero you need 2 error correction words. That leaves you with 13 data words (including padding words). Therefore the data words that you need to calculate the error correction words are as follows:
13,901,121,291,257,858,232,119,111,114,108,100,900
where 13 represents the number of data words that you generated (which is 11) plus the one padding word of 900 plus the length indicator (i.e 13) itself.
if your algorithm is right then using the above data words and 27 and 917 as error correction coefficients you should get 305 and 821 as your error correction words. My algorithm calculates it as such
I don't really idea about how to create pdf417 but once again I find this:
http://grandzebu.net/informatique/codbar-en/codbar.htm
Maybe this can help you. See ya !
Good luck.
精彩评论