Visual Basic - Imprimir en mini printer

Life is soft - evento anual de software empresarial
 
Vista:

Imprimir en mini printer

Publicado por Vicente (26 intervenciones) el 13/05/2009 00:17:22
Hola comunidad, tengo un proyecto de punto de venta, VB6 con MySQl. Tengo poco utilizando VB6, los informes los hago con Crystal Reports.
Tengo una miniprinter STAR SP512 que utiliza el puerto USB (Ya está instalada y configurada). No tengo la menor idea de como se utiliza el Object printer y acudo a uds. si alguien me puede ayudar con un pequeño ejemplo de como 'abrir' el puerto y la rutina del encabezado y cuando termina de imprimir.
De antemano gracias por su ayuda y buenos comentarios.

Saludos
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

Imprimir en mini printer

Publicado por Yosoy Bern (1 intervención) el 21/07/2018 21:13:20
Es algo muy simple, instala la impresora por default, busca los drivers en la web para windows 7, los ejemplos vienen en el manual

de todas formas te los dejo a continuación

Saludos

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
Private Sub Command1_Click()
'Printer.Font.Name = "Printer 17cpi Tall"
'Printer.Print "HELLO QUE TAL COMO ESTAS?"
Printer.Font.Name = "Printer 17cpi"
'Printer.Print
'Printer.Print
Printer.Print "HELLO QUE TAL COMO ESTAS?"
'Printer.Print
'Printer.Print
'Printer.EndDoc
End Sub
 
Private Sub Command2_Click()
Printer.Font.Name = "Printer 17cpi Tall"
Printer.Print "TSP1000 QR Code Test Print for VB 6.0"
Printer.Font.Name = "Printer 17cpi"
Printer.Print
Printer.Print
Printer.Print "Driver : Star TSP1000 QRcode Support"
Printer.Print
Printer.Print
Printer.Print "DATA:"
Printer.Print "http://www.star-m.jp/"
Printer.Print
Printer.Print "QR code:";
Printer.Font.Name = "QR_CNTL"
Printer.Print "M1"; ' Set Barcode font
Printer.Print "Eg"; ' Set up correct errors level
Printer.Print "S7" ' Set module size
Printer.Print "A0"; ' Set barcode data(auto) and Data type
Printer.Font.Name = "DATA1" ' DATA1 = 0x0000 - 0x005F
Printer.Print Chr(&H35); ' Bytes of barcode data
Printer.Print Chr(&H20);
Printer.Font.Name = "ESC_FONT" ' ESC_FONT = 0x0020 - 0x007F
Printer.Print "http://www.star-m.jp/";
Printer.Font.Name = "QR_CNTL"
Printer.Print "P" ' Print Barcode Data
Printer.EndDoc
End Sub
 
Private Sub Command3_Click()
Printer.Font.Name = "Printer 17cpi Tall"
Printer.Print "TSP1000 QR Code Test Print for VB 6.0"
Printer.Font.Name = "Printer 17cpi"
Printer.Print
Printer.Print
Printer.Print "Driver : Star TSP1000 QRcode Support"
Printer.Print
Printer.Print
Printer.Print "DATA:"
Printer.Print " Block-1-> Star Micronics"
Printer.Print " Block-2-> http://www.star-m.jp/"
Printer.Print
Printer.Print "QR code:";
Printer.Font.Name = "QR_CNTL"
Printer.Print "M2"; ' Set Barcode font
Printer.Print "El"; ' Set up correct errors level
Printer.Print "S8" ' Set module size
Printer.Print "B2"; ' Set barcode data(manual) and block
' Block-1
Printer.Font.Name = "QR_CNTL"
Printer.Print "2"; ' Data type
Printer.Font.Name = "DATA1" ' DATA1 = 0x0000 - 0x005F
Printer.Print Chr(&H2E); ' Bytes of barcode data
Printer.Print Chr(&H20);
Printer.Font.Name = "ESC_FONT" ' ESC_FONT = 0x0020 - 0x007F
Printer.Print "Star Micronics";
' Block-2
Printer.Font.Name = "QR_CNTL"
Printer.Print "3"; ' Data type
Printer.Font.Name = "DATA1" ' DATA1 = 0x0000 - 0x005F
Printer.Print Chr(&H35); ' Bytes of barcode data
Printer.Print Chr(&H20);
Printer.Font.Name = "DATA2" ' DATA2 = 0x0060 - 0x00BF
Printer.Print Chr(&H28); ' Caracter = "h" , Code = 0x0068
Printer.Print Chr(&H34); ' Caracter = "t" , Code = 0x0074
Printer.Print Chr(&H34); ' Caracter = "t" , Code = 0x0074
Printer.Print Chr(&H30); ' Caracter = "p" , Code = 0x0070
Printer.Font.Name = "DATA1" ' DATA1 = 0x0000 - 0x005F
Printer.Print Chr(&H5A); ' Caracter = ":" , Code = 0x003A
Printer.Print Chr(&H4F); ' Caracter = "/" , Code = 0x002F
Printer.Print Chr(&H4F); ' Caracter = "/" , Code = 0x002F
Printer.Font.Name = "DATA2" ' DATA2 = 0x0060 - 0x00BF
Printer.Print Chr(&H37); ' Caracter = "w" , Code = 0x0077
Printer.Print Chr(&H37); ' Caracter = "w" , Code = 0x0077
Printer.Print Chr(&H37); ' Caracter = "w" , Code = 0x0077
Printer.Font.Name = "DATA1" ' DATA1 = 0x0000 - 0x005F
Printer.Print Chr(&H4E); ' Caracter = "." , Code = 0x002E
Printer.Font.Name = "DATA2" ' DATA2 = 0x0060 - 0x00BF
Printer.Print Chr(&H33); ' Caracter = "s" , Code = 0x0073
Printer.Print Chr(&H34); ' Caracter = "t" , Code = 0x0074
Printer.Print Chr(&H21); ' Caracter = "a" , Code = 0x0061
Printer.Print Chr(&H32); ' Caracter = "r" , Code = 0x0072
Printer.Font.Name = "DATA1" ' DATA1 = 0x0000 - 0x005F
Printer.Print Chr(&H4D); ' Caracter = "-" , Code = 0x002D
Printer.Font.Name = "DATA2" ' DATA2 = 0x0060 - 0x00BF
Printer.Print Chr(&H2D); ' Caracter = "m" , Code = 0x006D
Printer.Font.Name = "DATA1" ' DATA1 = 0x0000 - 0x005F
Printer.Print Chr(&H4E); ' Caracter = "." , Code = 0x002E
Printer.Font.Name = "DATA2" ' DATA2 = 0x0060 - 0x00BF
Printer.Print Chr(&H2A); ' Caracter = "j" , Code = 0x006A
Printer.Print Chr(&H30); ' Caracter = "p" , Code = 0x0070
Printer.Font.Name = "DATA1" ' DATA2 = 0x0000 - 0x005F
Printer.Print Chr(&H4F); ' Caracter = "/" , Code = 0x002F
Printer.Font.Name = "QR_CNTL"
Printer.Print "P" ' Print Barcode Data
Printer.EndDoc
End Sub
 
Private Sub Command4_Click()
Printer.EndDoc
 
End Sub
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar