2

这是我在这个网站上的第一篇文章,似乎无法解决问题。

如何模拟键功能Ctrl+B到条码,这样我就可以用扫描仪扫描条码而无需按Ctrl+ B。我试过阅读 ASCII 控制代码ASCII 控制代码 请帮助我。

4

1 回答 1

1

正如您的一个标签所展示的那样,您已经知道代码 128 符号系统。您将需要使用 code128A 起始码 (103) 和与 code128B (66) 中的小写“b”相同的字符。最后,在添加额外数据后,正确计算校验和并将其与停止代码 (106) 一起添加。以下 HTML 说明:

<img 
alt="103,{Start A}" title="103,{Start A}" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAABAQMAAAAy+cYDAAAABlBMVEUAAAD///+l2Z/dAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAADklEQVQIHQEDAPz/AC9gAMEAkBQ+aMgAAAAASUVORK5CYII=" width="20" height="40"><img
alt=" 66,A:{STX},B:{b}" title=" 66,A:{STX},B:{b}" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAABAQMAAAAy+cYDAAAABlBMVEUAAAD///+l2Z/dAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAADklEQVQIHQEDAPz/AG8gAQEAkGqGy8gAAAAASUVORK5CYII=" width="20" height="40"><img
alt=" 52,A:{T},B:{T}" title=" 52,A:{T},B:{T}" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAABAQMAAAAy+cYDAAAABlBMVEUAAAD///+l2Z/dAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAADklEQVQIHQEDAPz/ACOgAOkAxNCxwt0AAAAASUVORK5CYII=" width="20" height="40"><img
alt=" 37,A:{E},B:{E}" title=" 37,A:{E},B:{E}" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAABAQMAAAAy+cYDAAAABlBMVEUAAAD///+l2Z/dAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAADklEQVQIHQEDAPz/AHLgAccBU7KPeu8AAAAASUVORK5CYII=" width="20" height="40"><img
alt=" 51,A:{S},B:{S}" title=" 51,A:{S},B:{S}" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAABAQMAAAAy+cYDAAAABlBMVEUAAAD///+l2Z/dAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAADklEQVQIHQEDAPz/ACLgAScBA3yI80wAAAAASUVORK5CYII=" width="20" height="40"><img
alt=" 52,A:{T},B:{T}" title=" 52,A:{T},B:{T}" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAABAQMAAAAy+cYDAAAABlBMVEUAAAD///+l2Z/dAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAADklEQVQIHQEDAPz/ACOgAOkAxNCxwt0AAAAASUVORK5CYII=" width="20" height="40"><img
alt=" 24,A:{8},B:{8}" title=" 24,A:{8},B:{8}" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAABAQMAAAAy+cYDAAAABlBMVEUAAAD///+l2Z/dAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAADklEQVQIHQEDAPz/ABZgAI8Ad3Mh6bwAAAAASUVORK5CYII=" width="20" height="40"><img
alt="106,{Stop}"title="106,{Stop}"src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA0AAAABAQMAAAA/57ZEAAAABlBMVEUAAAD///+l2Z/dAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAADklEQVQIHQEDAPz/ADigARMA2dpJzT8AAAAASUVORK5CYII=" width="20" height="40">

要进行测试,请打开写字板或任何使用“Ctrl-B”打开和关闭粗体文本的文字处理器。扫描片段中条形码的打印副本。每次扫描时,您应该会看到文本“TEST”在粗体和普通样式之间交替出现。

<img 
alt="103,{Start A}" title="103,{Start A}" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAABAQMAAAAy+cYDAAAABlBMVEUAAAD///+l2Z/dAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAADklEQVQIHQEDAPz/AC9gAMEAkBQ+aMgAAAAASUVORK5CYII=" width="12" height="33"><img
alt=" 66,A:{STX},B:{b}" title=" 66,A:{STX},B:{b}" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAABAQMAAAAy+cYDAAAABlBMVEUAAAD///+l2Z/dAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAADklEQVQIHQEDAPz/AG8gAQEAkGqGy8gAAAAASUVORK5CYII=" width="12" height="33"><img
alt=" 66,A:{STX},B:{b}" title=" 66,A:{STX},B:{b}" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAABAQMAAAAy+cYDAAAABlBMVEUAAAD///+l2Z/dAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAADklEQVQIHQEDAPz/AG8gAQEAkGqGy8gAAAAASUVORK5CYII=" width="12" height="33"><img
alt="106,{Stop}"title="106,{Stop}"src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA0AAAABAQMAAAA/57ZEAAAABlBMVEUAAAD///+l2Z/dAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAADklEQVQIHQEDAPz/ADigARMA2dpJzT8AAAAASUVORK5CYII=" width="12" height="33">

于 2017-07-20T21:01:30.917 回答