如何在 .NET 中创建 MSI、Plessey 和 Standard 2 of 5 Barcodes for Inventory and Warehouse Labels
如何在 .NET 中创建 MSI、Plessey 和 Standard 2 of 5 Barcodes for Inventory and Warehouse Labels
什么是MSI,Plessey和标准2的5条条码?
MSI(Modified Plessey)和Standard 2 of 5是用于仓库、库存、图书馆和工业跟踪的数字仅1D条码,它们因其简单性和与遗产和现代系统的兼容性而被评估。
快速启动(最小例子)
using Aspose.BarCode.Generation;
var generator = new BarcodeGenerator(EncodeTypes.MSI, "1234567890");
generator.Save("msi-barcode.png", BarCodeImageFormat.Png);
内容表
引入
本文涵盖了 MSI、Plessey 和 Standard 2 的 5 条代码,用于大批存储、图书馆和仓库标签,使用 Aspose.BarCode for .NET。
原則
- Visual Studio 2019 或以后
- .NET 6.0+ 或 .Net Framework 4.6.2+
- Aspose.BarCode 为 .NET (NuGet)
- 基本的C#知识
PM> Install-Package Aspose.BarCode
步骤实施
MSI 例子:
using Aspose.BarCode.Generation;
BarcodeGenerator gen = new BarcodeGenerator(EncodeTypes.MSI, "1234567890");
gen.Save("msi-barcode.png", BarCodeImageFormat.Png);
Plessey 例子:
BarcodeGenerator gen = new BarcodeGenerator(EncodeTypes.Plessey, "987654321");
gen.Save("plessey-barcode.png", BarCodeImageFormat.Png);
標準 2 的 5 例子:
BarcodeGenerator gen = new BarcodeGenerator(EncodeTypes.Standard2of5, "123456");
gen.Save("standard2of5-barcode.png", BarCodeImageFormat.Png);
支票和定制选项
- MSI Checksum: ``csgen.Parameters.Barcode.Msi.EnableCheckum = 真实;参数:MsiChecksumMode.Mod10;
酒吧高度/宽度:
csgen.Parameters.Barcode.BarHeight.Pixels = 80; gen.Parameters.Barcode.XDimension.Pixels = 2;
色彩/背景:
csgen.Parameters.Barcode.BarColor = Color.DarkSlateGray; gen.Parameters.Barcode.BackColor = Color.WhiteSmoke;
主条目:
csgen.Parameters.CaptionBelow\.Visible = true;
定制条形码的出现
- 上面查看字符串高度、宽度和颜色
- 调整 XDimension 和 BarHeight 为不同标签尺寸
- 使用 SVG 可扩展、Crisp 打印
支持的输出格式
- PNG、JPEG、BMP - 印刷和数字
- TIFF - 高品质仓库打印机
- SVG,EMF - 大规模或档案
麻烦解决与常见问题
行李箱不扫描?
确保只有数字输入,您的扫描仪的有效长度,正确的对比。
“检查错误吗?”
允许/禁用支票,以匹配您的扫描仪设置。
“字母太小了吗?”
使用较小的 XD 尺寸和较低的 BarHeight。
FAQ
**Q:这些条码是否由所有扫描仪支持?**答:大多数工业和仓库扫描仪支持 MSI、Plessey 和 Standard 2 of 5,但检查您的硬件文档。
问:我可以收集成千上万的标签吗?答:是的,通过存储数据旋转,并以编程方式创建图像。
使用案例和应用程序
- 集体仓库和存储标签
- 图书馆和档案系统
- 工业设备跟踪
- 运输容器和本标签
最佳实践:快速参考表
提示 | 做 | 不要 |
---|---|---|
Input | 只使用数字 | 使用字母或符号 |
支票 | 如果工作流需要 | 如果不支持 |
输出格式 | SVG/PNG 为 CRISP 输出 | 印刷低 JPG |
Batch 世代 | 大型存储自动化 | 手动标签创建 |
结论
MSI、Plessey 和 Standard 2 of 5 条码仍然对存储和仓库操作至关重要。 Aspose.BarCode API 参考 更多细节。