没有找到合适的产品?
联系客服协助选型:023-68661681
提供3000多款全球软件/控件产品
针对软件研发的各个阶段提供专业培训与技术咨询
根据客户需求提供定制化的软件开发服务
全球知名设计软件,显著提升设计质量
打造以经营为中心,实现生产过程透明化管理
帮助企业合理产能分配,提高资源利用率
快速打造数字化生产线,实现全流程追溯
生产过程精准追溯,满足企业合规要求
以六西格玛为理论基础,实现产品质量全数字化管理
通过大屏电子看板,实现车间透明化管理
对设备进行全生命周期管理,提高设备综合利用率
实现设备数据的实时采集与监控
利用数字化技术提升油气勘探的效率和成功率
钻井计划优化、实时监控和风险评估
提供业务洞察与决策支持实现数据驱动决策
翻译|行业资讯|编辑:胡涛|2023-09-19 10:19:20.013|阅读 50 次
概述:在这篇博文中,我们将学习如何使用 Aspose.Barcode条码控件,在Python 开发 128 条码生成器。
# 界面/图表报表/文档/IDE等千款热门软控件火热销售中 >>
相关链接:
条形码是当今企业不可或缺的一部分,从库存管理到零售交易。Code 128 是最通用、使用最广泛的条形码之一。Code 128 条形码为标记产品、跟踪资产和提高运营效率提供了实用的解决方案。在这篇博文中,我们将学习如何使用 Aspose.Barcode条码控件,在Python 开发 128 条码生成器。
Aspose.BarCode for .NET 是一个功能强大的API,可以从任意角度生成和识别多种图像类型的一维和二维条形码。开发人员可以轻松添加条形码生成和识别功能,以及在.NET应用程序中将生成的条形码导出为高质量的图像格式。 Aspose API支持流行文件格式处理,并允许将各类文档导出或转换为固定布局文件格式和最常用的图像/多媒体格式。
本文涵盖以下主题:
我们将使用Aspose.BarCode for Python 生成 128 个条形码。它是一个强大、可靠且用户友好的条形码生成和识别解决方案。它支持多种一维和二维条码类型。
请在控制台中使用以下 pip 命令从PyPI下载软件包或安装 API :
pip install aspose-barcode-for-python-via-net
我们可以按照以下步骤轻松生成 Code 128 条形码:
以下代码示例演示如何在 Python 中生成代码 128 条形码。
# This code example demonstartes how to generate a Code 128 barcode. import aspose.barcode as barcode # Initialize the BarcodeGenerator # Specify Encode type generator = barcode.generation.BarcodeGenerator(barcode.generation.EncodeTypes.CODE128) # Code text generator.code_text = "123456ABCDEF" # Save the generated barcode generator.save("C:\\Files\\Generate_Code_128.jpg")
我们可以按照以下步骤轻松生成 GS1-128 条形码:
以下代码示例演示如何在 Python 中生成 GS1-128 条形码。
# This code example demonstartes how to generate a GS1 128 barcode. import aspose.barcode as barcode # Initialize the BarcodeGenerator # Specify Encode type as GS1_CODE_128 generator = barcode.generation.BarcodeGenerator(barcode.generation.EncodeTypes.GS1_CODE_128) # Code text generator.code_text = "(01)12345678901231(21)ASPOSE(30)9876" # Save the generated barcode generator.save("C:\\Files\\GS1_128.jpg")
我们还可以按照前面提到的步骤生成一个条形码标签,其中在同一图像中放置一个额外的 GS1-128 优惠券条形码。但是,我们需要在第一步中将EncodeTypes设置为UPCA_GS_1_CODE_128_COUPON 。
以下代码示例演示如何在 Python 中生成 UPC-A GS1 Code 128 优惠券。
# This code example demonstartes how to generate a GS1 128 Coupon barcode. import aspose.barcode as barcode # Initialize the BarcodeGenerator # Specify Encode type generator = barcode.generation.BarcodeGenerator(barcode.generation.EncodeTypes.UPCA_GS_1_CODE_128_COUPON) # Code text generator.code_text = "123456789012(8110)ASPOSE" # Save the generated barcode generator.save("C:\\Files\\GS1_128_COUPON.jpg")
我们还可以按照前面提到的步骤自定义条形码的外观。但是,在最后一步中保存图像之前,我们需要指定其他属性。
以下代码示例演示如何在 Python 中自定义 GS1 128 Coupon 的条形码外观。
# This code example demonstartes how to customize the appearance of a GS1 128 Coupon barcode. import aspose.barcode as barcode from aspose.pydrawing import Color, FontStyle # Initialize the BarcodeGenerator # Specify Encode type generator = barcode.generation.BarcodeGenerator(barcode.generation.EncodeTypes.UPCA_GS_1_CODE_128_COUPON) # Code text generator.code_text = "123456789012(8110)ASPOSE" # Customize caption above generator.parameters.caption_above.text ="CAPTION ABOVE" generator.parameters.caption_above.visible = True generator.parameters.caption_above.font.style = FontStyle.ITALIC generator.parameters.caption_above.font.size.point = 5.0 # Customize caption below generator.parameters.caption_below.text = "CAPTION BELOW" generator.parameters.caption_below.visible = True generator.parameters.caption_below.font.style = FontStyle.BOLD generator.parameters.caption_below.font.size.pixels = 15.0 generator.parameters.caption_above.font.family_name = "Verdana" # Customize bar color bar_color = Color(0x00, 0x00, 0xFF) generator.parameters.barcode.bar_color = bar_color # Specify the X-dimension # the smallest width of the unit of BarCode bars or spaces generator.parameters.barcode.x_dimension.pixels = 2.0; # Set coupon supplement space 50 pixels generator.parameters.barcode.coupon.supplement_space.pixels = 50.0; # Set bar height generator.parameters.barcode.bar_height.pixels = 50.0; # Save the generated barcode generator.save("C:\\Files\\Customize_Code_128.jpg")
以上便是如何借助Aspose.BarCode,在Python 中生成 Code 128 条形码,希望能帮到您,除此之外,你有其他方面的需求,也欢迎和我们互动,或这下体验~
欢迎下载|体验更多Aspose产品
本站文章除注明转载外,均为本站原创或翻译。欢迎任何形式的转载,但请务必注明出处、不得修改原文相关链接,如果存在内容上的异议请邮件反馈至chenjj@wqylolg.cn
本文将从产品功能、核心优势及行业应用场景三个维度,解析Aspose的热门产品如何助力企业提升文档管理效率。
产线级 MES 通过与检测设备的深度集成,实现数据的自动采集和智能分析,为企业提供更加精准、高效的质量管理方案。
HOOPS Communicator作为一款强大的工业设计工具,其碰撞检测和运动模拟功能为工程师和设计师提供了invaluable的支持。通过不断的技术创新和功能优化,HOOPS Communicator将助力企业在数字化转型的浪潮中,实现更加高效、智能和精准的工业设计与制造,引领工业设计走向新的高度。
顶级、高效、精准的条码读写控件,它不仅能识别文档,还能识别文件夹,甚至能识别医疗记录等。
TBarCode SDKTBarCode SDK是一款可以在任意应用程序和打印机下生成和打印所有条码的条码软件组件。
Barcode Studio快速且高品质地设置条码图像例如单条和串行条形码,位图或矢量图形
Aspose.BarCode for C++创建或识别1D和2D条形码类型以及将生成的条形码导出为C ++应用程序中的多种图像格式。
服务电话
重庆/ 023-68661681
华东/ 13452821722
华南/ 18100878085
华北/ 17347785263
客户支持
技术支持咨询服务
服务热线:400-700-1020
邮箱:sales@wqylolg.cn
关注我们
地址 : 重庆市九龙坡区火炬大道69号6幢