使用 iTextSharp 的 Code128B 和 Code128C 单个条形码
我希望使用 iTextSharp DLL 生成混合 code128B 和 code128C 的条形码。你知道该怎么做吗?我目前只知道单个代码集。
例如,我希望生成一个值为 8L1 91450 883421 0550 001065 的条形码 其中“8L1 91450”位于代码128B 中,“883421 0550 001065”位于代码128C 中。
谢谢
I wish to generate a barcode mixing code128B and code128C with iTextSharp DLL. Do you know how to do that ? I currently know only with a single codeset.
By example, I wish to generate a barcode with the value 8L1 91450 883421 0550 001065
where "8L1 91450" is in code128B and "883421 0550 001065" is in code128C.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果可以的话,
Barcode128
实际上会自动从B
切换到C
,但听起来您不希望这样。对于您要查找的控件,您需要将条形码的CodeType
属性设置为Barcode.CODE128_RAW
并手动设置原始值。有夫妇的帖子 给出了基本的想法但不幸的是,他们往往假定自己对 iText 或条形码有太多了解。
我也不是条形码专家,但基本想法是创建一个以
Barcode128.START_B
开头的字符串,然后是文本的第一部分,然后是Barcode128.START_C
然后是第二个。然而,在原始模式下,文本不是 ASCII。您可以使用此站点获取各种 ASCII 值的字符代码。但基本上,您不会发送字母L
,而是发送(char)44
。希望这至少能让你开始。
Barcode128
will actually automatically switch fromB
toC
if and when it can but it sounds like you don't want this. For the control that you're looking for you'll need to set your barcode'sCodeType
property toBarcode.CODE128_RAW
and manually set the raw values.There's a couple of posts out there that give the basic idea but unfortunately they tend to assume to much knowledge of iText or too much knowledge of barcodes.
I'm not a barcode expert either but the basic idea is to create a string that starts with
Barcode128.START_B
, then the first part of your text, thenBarcode128.START_C
and then the second. When in raw mode, text isn't ASCII, however. You can use this site to get the character codes for various ASCII values. But basically instead of sending the letterL
you'd send(char)44
.Hopefully this gets you started at least.