gpt4 book ai didi

barcode - 如何生成传真后 cocoa 靠读取的 Code 39

转载 作者:行者123 更新时间:2023-12-02 04:18:59 24 4
gpt4 key购买 nike

我的应用程序正在生成 Code 39 条形码,但客户的文档管理系统在扫描并重新打印打印件后识别条形码时遇到问题。

我还使用在线条形码阅读器对其进行了测试,该阅读器确认其最终文档上的条形码不可读。

是否有一种最佳类型的条形码可供使用,可以在其他地方打印、扫描和重新打印后提供最佳结果?

这是直接来自应用程序的 PDF 中的原始条形码:

enter image description here

这是经过打印、扫描和重新打印后的条形码:

enter image description here

使用在线条形码阅读器进行测试的结果是:

We are sorry, we could not found any barcode in the uploaded image.

我正在使用 GNU Barcode 来生成条形码:

$ barcode -h
barcode: Options:
-i <arg> input file (strings to encode), default is stdin
-o <arg> output file, default is stdout
-b <arg> string to encode (use input file if missing)
-e <arg> encoding type (default is best fit for first string)
-u <arg> unit ("mm", "in", ...) used to decode -g, -t, -p
-g <arg> geometry on the page: [<wid>x<hei>][+<margin>+<margin>]
-t <arg> table geometry: <cols>x<lines>[+<margin>+<margin>]
-m <arg> internal margin for each item in a table: <xm>[,<ym>]
-n "numeric": avoid printing text along with the bars
-c no Checksum character, if the chosen encoding allows it
-E print one code as eps file (default: multi-page ps)
-P create PCL output instead of postscript
-p <arg> page size (refer to the man page)

Known encodings are (synonyms appear on the same line):
"ean", "ean13", "ean-13", "ean8", "ean-8"
"upc", "upc-a", "upc-e"
"isbn"
"39", "code39"
"128c", "code128c"
"128b", "code128b"
"128", "code128"
"128raw"
"i25", "interleaved 2 of 5"
"cbr", "codabar"
"msi"
"pls", "plessey"
"code93", "93"

最佳答案

Code 39 是一种低数据密度条形码,可容纳较宽的 X 尺寸(窄条的宽度)和高度区分的窄宽比(高达 1:3)。就条形码符号体系而言,这使其比其他符号更适合在低分辨率、嘈杂的介质上传输。

Code 39 标准允许使用模 43 校验位,从而减少误读的可能性。我注意到它不存在于您的扫描图像中(尽管它存在于您的源图像中),因此也许您的系统可以升级以适应这种情况。

您提供的图像最重要的问题是最窄空间的宽度过小,导致条形码损坏。在源图像的情况下,这是由于像素掠过导致的过度“打印增长”(墨水扩散)。在扫描图像的情况下,这种情况被夸大了,因为所选的 X 维度不足以承受端到端过程引入的成像缺陷。

为了演示打印增长的效果,我将扫描图像与相同数据的更清晰的再现叠加在一起:

Superimposed Code 39 barcodes

您可以观察到,在图像的右侧,两个相邻窄条之间的狭窄空间已被压缩到图像之外,形成单个宽条。

要从源头上改进,您可以尝试以下操作:

  • 通过确保执行条形码生成时将符号的 X 尺寸设置为输出设备原始分辨率的倍数来避免像素掠过 - 这一过程有时称为“网格拟合”。<
  • 通过修改 GNU 条形码库以从条宽度中减去少量固定量来补偿墨水扩散,以便与您的打印和扫描过程兼容。
  • 将条形和空格的窄宽比最大化至 1:3。
  • 最大化您的 X 维度。

迁移到另一个线性条形码符号系统不太可能有帮助,因为这些相同的问题可能会在更大程度上影响它。

有关高质量条形码生成的更多信息,请参见 this answer .

关于barcode - 如何生成传真后 cocoa 靠读取的 Code 39,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31806061/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com