vb 对 zebra 888-TT打印机编程

前端之家收集整理的这篇文章主要介绍了vb 对 zebra 888-TT打印机编程前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

打印机:zebra 888-TT

控制语言: EPL2 (很多zebra用的ZPL2 )

vb源码:

Private Sub Command1_Click()
Dim id
id = Form1.Text1.Text
If (id <> "") Then
strsql = "select * from stock where item='" & id & "'"
open_db (strsql)

If Not rs.EOF Then

Dim p_name
Dim stock
Dim check_no

p_name = rs.Fields.Item(1).Value
stock = rs.Fields.Item(2).Value
check_no = rs.Fields.Item(3).Value


Open App.Path & "/print.ext" For Output As #1

'ZPL 的命令*********************
Print #1," "
Print #1,"N"

Print #1,"A30,5,8,1,N," & Chr(34) & "图番号" & Chr(34)
Print #1,Chr(13) + Chr(10)
Print #1,"A130,2," & Chr(34) & id & Chr(34)
Print #1,Chr(13) + Chr(10)

Print #1,50," & Chr(34) & "品名" & Chr(34)
Print #1,"A105," & Chr(34) & p_name & Chr(34)
Print #1,95," & Chr(34) & "棚番号" & Chr(34)
Print #1," & Chr(34) & stock & Chr(34)
Print #1,"A250," & Chr(34) & "入检号" & Chr(34)
Print #1,"A350," & Chr(34) & check_no & Chr(34)
Print #1,Chr(13) + Chr(10)


Print #1,"B30,140,3,70,B,"P1"

Close #1
FileCopy "print.ext","lpt1"

'*******************************************************
Else
Dim response
response = MsgBox(" 图番号不存在!","提示")
End If
Call close_db
Form1.Text1.Text = ""
Form1.Text1.SetFocus
Else
Dim alert
alert = MsgBox(" 请输入图番号!","提示")
End If
End Sub

EPL2命令说明

EPL2严格区分大小写

A

语法 Ap1,p2,p3,p4,p5,p6,p7,“DATA”
参数 p1=以象素点为单位的水平起始位置

p2=以象素点为单位的垂直起始位置

p3=旋转

Value Description
0 No rotation
1 90 degrees
2 180 degrees
3 270 degrees

4 No rotation
5 90 degrees
6 180 degrees
7 270 degrees

4-7是针对亚洲字体的设置

p4=字体选择

Value Description
203 dpi 300 dpi

1 20.3 cpi,6 pts,25 cpi,4 pts,
(8 x 12 dots) (12 x 20 dots)

2 16.9 cpi,7 pts,18.75 cpi,
(10 x 16 dots) (16 x 28 dots)

3 14.5 cpi,10 pts,15 cpi,8 pts,
(12 x 20 dots) (20 x 36 dots)

4 12.7 cpi,12 pts,12.5 cpi,
(14 x 24 dots) (24 x 44 dots)

5 5.6 cpi,24 pts,6.25 cpi,21 pts,
(32 x 48 dots) (48 x 80 dots)

6 Numeric Only Numeric Only
(14 x 19 dots) (14 x 19 dots)

7 Numeric Only Numeric Only
(14 x 19 dots) (14 x 19 dots)

亚洲打印机

Simplified Chinese,Japanese,Korean

8 203 dpi fonts : 24 x 24 dots
300 dpi Double-byte fonts : 36 x 36 dots
300 dpi Single-byte fonts : 24 x 36 dots

Traditional Chinese,Japanese
9 300 dpi Double-byte fonts: 36 x 36 dots
300 dpi Single-byte fonts : 24 x 36 dots
Korean - Reserved

p5=水平膨胀,值:1-6&8

p6=垂直膨胀,值:1-9

p7=N代表普通,R表示反转图象

"DATA"=数据

B

用于打印标准条码

语法:Bp1,p8,“DATA”

参数 p1=以象素点为单位的水平起始位置

p2=以象素点为单位的垂直起始位置

p3=旋转

Value Description
0 No rotation
1 90 degrees
2 180 degrees
3 270 degrees

p4=条码选择,参见条码表

p5=窄条的象数宽度,参见条码表

p6=宽条的象数宽度,参见条码表

p7=条码的象素高度

p8=打印可读代码,值 B=是,N=否

"DATA"=数据

条码表

Description P4 P5 P6
Value Value Value

Code 39 std. or extended 3 1-10 YCode 39 with check digit 3C 1-10 NCode 93 9 1-10 NCode 128 UCC Serial Shipping Container Code 0 1-10 NCode 128 auto A,C modes 1 1-10 NCode 128 mode A 1A 1-10 NCode 128 mode B 1B 1-10 NCode 128 mode C 1C 1-10 NCode 128 with Deutsche Post check digit4 1D 2-10 NCodabar K 1-10 YEAN8 E80 2-4 NEAN8 2 digit add-on E82 2-4 NEAN8 5 digit add-on E85 2-4 NEAN13 E30 2-4 NEAN13 2 digit add-on E32 2-4 NEAN13 5 digit add-on E35 2-4 NGerman Post Code 2G 3-4 NInterleaved 2 of 5 2 1-10 YInterleaved 2 of 5 with mod 10 check digit 2C 1-10 YInterleaved 2 of 5 with human readablecheck digit 2D 1-10 YPostnet 5,9,11 & 13 digit1 P — NPlanet 11 & 13 digit1 PL — NJapanese Postnet3 J — —UCC/EAN 1282 1E 1-10 NUPC A UA0 2-4 NUPC A 2 digit add-on UA2 2-4 NUPC A 5 digit add-on UA5 2-4 NUPC E UE0 2-4 NUPC E 2 digit add-on UE2 2-4 NUPC E 5 digit add-on UE5 2-4 NUPC Interleaved 2 of 5 2U 1-10 YPlessey (MSI-1) with mod. 10 check digit L — —MSI-3 with mod. 10 check digit M — —

原文链接:https://www.f2er.com/vb/264128.html

猜你在找的VB相关文章