生成PDF417条码:纠错码字不正确

发布于 2024-09-12 17:11:52 字数 751 浏览 2 评论 0原文

我正在尝试创建一个生成 PDF417 条形码的应用程序。为此,我遵循本指南: http://grandzebu.net/informatique/ codbar-en/pdf417.htm

我生成数据码字很好,但是当我使用算法生成纠错时,结果似乎工作得不好,我认为问题是我传递给它的数据。

我正在尝试的基本测试是使用数据生成 Pdf417 条形码:Hello world,

我正在使用字节模式编码。

生成的条形码有 3 行和 5 数据列。

我用来生成校正码字的数据码字是这些:

[901, 121, 291, 257, 858, 232, 119, 111, 114, 108, 100]

当我使用付费库生成具有相同数据的条形码时,校正码字(使用错误校正级别 0)如下: [821, 305]

但是当我使用我的算法生成条形码时,我得到的校正码字是 [791, 594]。

我还尝试使用此处找到的算法: http://sourceforge.net/projects/pdf417lib/ ,结果与我的算法相同。

知道我做错了什么吗?

非常感谢您抽出时间。

I'm trying 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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

单调的奢华 2024-09-19 17:11:52

5 列 3 行总共需要 15 个单词。因为您使用的是零纠错级别,所以您需要 2 个纠错字。这样您就剩下 13 个数据字(包括填充字)。因此,计算纠错字所需的数据字如下:

13,901,121,291,257,858,232,119,111,114,108,100,900

其中 13 表示您生成的数据字数(即 11)加上 900 的一个填充字加上长度指示符(即 13)本身。

如果你的算法是正确的,那么使用上面的数据字以及27和917作为纠错系数,你应该得到305和821作为你的纠错字。我的算法是这样计算的

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

装迷糊 2024-09-19 17:11:52

我真的不知道如何创建 pdf417,但我再次发现:

http:// /grandzebu.net/informatique/codbar-en/codbar.htm

也许这可以帮助您。再见!

祝你好运。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文