使用vb6中的打印机对象打印Code128条形码(使用字体)

问题描述 投票:2回答:1

我们有一些古老的vb6程序,它使用依赖于窗口字体的打印机对象创建条形码,这对于代码39可以正常工作。最近我们需要将字体切换到code128,经过一些工作我们将输入转换为code128格式字符串,并尝试使用相同的方法打印,但是,打印输出似乎不对(奇怪的是,当我们将转换后的字符串复制到excel并使用相同的代码128字体打印出来,完美显示和打印出来)

我想知道是否有人有同样的经历,如果是这样,有人可以粉碎一些灯吗?

以下是我们用于打印条形码的代码

dim sOrg as string
sOrg = "12345888"

printer.fontName = "code39"
printer.print sOrg    'This prints it out perfectly

'However when we change font to code
'this returns   Í,BZx}Î   which can be copy onto Excel and print out properly
sOrg = convertTo128(sOrg)   
printer.fontName = "Code 128"
printer.print sOrg     'print out with part barcode line, part squares 
printing vb6 code128
1个回答
0
投票

您可以使用以下项目,其中包括VB6项目和打开条码字体

barcode fonts and encoders

© www.soinside.com 2019 - 2024. All rights reserved.