将条形码文本转换为Microsoft Word呈现为字体所需的code128格式 [英] Converting barcode text to code128 required format for Microsoft Word to render as font

查看:205
本文介绍了将条形码文本转换为Microsoft Word呈现为字体所需的code128格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将字母数字文本转换为Code128条码类型的所需格式.然后,我将其嵌入安装了code128类型字体的Microsoft Word模板中,并将其打印出来以使其可扫描.

I am trying to convert an alphanumeric text to the required format of Code128 barcode type. I will then embed this in Microsoft Word template which has code128 type fonts installed and print it out to make it scannable.

Code39可以按预期工作,因为它很容易将其转换为所需的格式.您只需以星号(*)开头和结尾.

Code39 works as intended because it is easy to convert it into the required format. You just start and end with asterisk (*).

如何在javascript中将文本转换为code128格式的必需字符串?​​

How can I convert a text to required string for code128 format in javascript?

我尝试了开源JsBarcode库.我可以获取条形码的二进制数据,可以从那里进行转换,还是应该只查找code128表并进行ascii计算?

I have tried the open source JsBarcode library. I can get the binary data of the barcode, can I convert from there, or should I just look up the code128 table and make the ascii calculations?

示例输入:

Code 128456

示例输出:

ÌCodeÂÇ,tXXÎ

参考

谢谢.

推荐答案

代码128"font"是伪字体,输入的不是文本字符,它是计算所得的空格,并标有"characters".计算的字符"取决于字体的设计者.因此,您必须识别它并使用设计者的算法.

A Code 128 "font" is a pseudo-font, the input is not text characters, it's calculated space and mark "characters". The computed "characters" depend on the designer of the font. So you'll have to identify it and use the designer's algorithm.

代码128还增加了校验和的复杂性.这也必须使用空格进行计算并渲染,并标记字符".

Code 128 also has the added complexity of a checksum. That has to be computed and rendered with space and mark "characters," too.

因此,您始终需要渲染函数的输出并将字体应用于该输出.在文本上应用Code 128字体无效.

So, you'll always need to render the output of function and apply the font to it. Applying a Code 128 font to text won't work.

这篇关于将条形码文本转换为Microsoft Word呈现为字体所需的code128格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆