本文介绍了Ean-128 Python条码生成器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有任何Python库可生成ean128条码.我尝试了"python-barcode",但是在该库中,ean128没有选择.

Is there any python library to generate ean128 barcode. I tried 'python-barcode' , but in that library there is no option for ean128.

推荐答案

最初提出此问题的人可能不会从中受益,但这是针对仍在寻找答案的人.

The person who originally asked this question may not benefit from this, but this is for those who are still looking for an answer.

注意:代码128与GS1-128不同

Note: Code-128 is not same as GS1-128

几天前我也对此问题感到困惑,最终我设法找到了一个支持GS1-128(UCC/EAN-128)条码的python库.

I was also stuck with this issue a few days ago, and I finally managed to find a python library which supports the GS1-128(UCC/EAN-128) barcode.

我所指的库称为"treepoem".奇怪的名字我同意,这就是很难找到它的原因.它是BWIPP库的包装.并且它也依赖于ghostscript.关于名字;条码->树皮颂歌->树诗.

The library I am referring to is called "treepoem". Strange name I agree that's what makes it so hard to find. It is a wrapper for BWIPP library. And it has a dependency on ghostscript as well. About the name; Barcode -> Bark ode -> Tree poem.

重要链接:1)Ghostscript;下载并安装它,并将其"bin"和"lib"文件夹添加到
系统的路径变量. https://www.ghostscript.com/download/gsdnld.html 2)树诗 https://pypi.org/project/treepoem/3)所有代码;在存储库中的此处,您将在此处找到所有受支持的条形码. https://github.com/adamchainz/treepoem/blob/master/treepoem/data.py

Important links:1) Ghostscript; download and install it and also add its "bin" and "lib" folder to
system's path variable. https://www.ghostscript.com/download/gsdnld.html2)treepoem https://pypi.org/project/treepoem/3) All-codes; here in the repository you will find all supported barcodes here. https://github.com/adamchainz/treepoem/blob/master/treepoem/data.py

import treepoem
image = treepoem.generate_barcode(
     barcode_type='gs1-128',  # One of the BWIPP supported codes.
     data='(01)14-digit-product-code')
image.convert('1').save('barcode.png')

这篇关于Ean-128 Python条码生成器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-03 06:32