Imprimente Code a bare

Mi_ne32 Messages postés 3 Date d'inscription jeudi 25 novembre 2004 Statut Membre Dernière intervention 31 décembre 2004 - 31 déc. 2004 à 12:57
cs_ITALIA Messages postés 2169 Date d'inscription vendredi 20 avril 2001 Statut Membre Dernière intervention 30 juin 2009 - 12 mai 2005 à 10:06
Mr Vb.
Bonjour tt le monde j'ai une petit question a vous poser,
Comment peut on communiquer avec une imprimente de Code a barre ( Exemlpe - Averty DENNISOn AP 2.4 ) .
meme si elle bien configuré sur mon PC et quand je lance une impression l'imprimante ne repond pas.
pour imprimer j'utiliser la methode Printer.print
Merci

3 réponses

cs_trabice Messages postés 328 Date d'inscription mercredi 26 novembre 2003 Statut Membre Dernière intervention 24 novembre 2005 1
31 déc. 2004 à 14:22
c du ZPL?

fabrice
0
cs_trabice Messages postés 328 Date d'inscription mercredi 26 novembre 2003 Statut Membre Dernière intervention 24 novembre 2005 1
31 déc. 2004 à 14:26
normalement tu communique avec cette imprimante par hyper terminal,
sinon tu pe lui envoyer un fichier texte contenant du ZPL (je parle de ce que je connai..)

moi j utilisai ca :

dans un module :

Private Type DOCINFO: pDocName As String: pOutputFile As String: pDatatype As String: End Type
Private Declare Function ClosePrinter Lib "winspool.drv" (ByVal hPrinter As Long) As Long
Private Declare Function EndDocPrinter Lib "winspool.drv" (ByVal hPrinter As Long) As Long
Private Declare Function EndPagePrinter Lib "winspool.drv" (ByVal hPrinter As Long) As Long
Private Declare Function OpenPrinter Lib "winspool.drv" Alias "OpenPrinterA" (ByVal pPrinterName As String, phPrinter As Long, ByVal pDefault As Long) As Long
Private Declare Function StartDocPrinter Lib "winspool.drv" Alias "StartDocPrinterA" (ByVal hPrinter As Long, ByVal Level As Long, pDocInfo As DOCINFO) As Long
Private Declare Function StartPagePrinter Lib "winspool.drv" (ByVal hPrinter As Long) As Long

Private Declare Function WritePrinter Lib "winspool.drv" (ByVal hPrinter As Long, pBuf As Any, ByVal cdBuf As Long, pcWritten As Long) As Long
Declare Function WriteProfileString Lib "kernel32" Alias "WriteProfileStringA" (ByVal lpszSection As String, ByVal lpszKeyName As String, ByVal lpszString As String) As Long
Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As String) As Long

Public portimpri(0 To 50) As String

Function PText(FilePath As String)
Dim lhPrinter
Dim lpcwritten
Dim x
Dim m$
If FilePath = "" Then Exit Function
If Dir(FilePath) = "" Then MsgBox "Fichier Spool introuvable (" + Command$ + ").", vbCritical: Exit Function
Dim MyDocInfo As DOCINFO
x = OpenPrinter(Printer.DeviceName, lhPrinter, 0)
If x = 0 Then MsgBox "Pas d'imprimante par défaut.", vbCritical: Exit Function
Open FilePath For Binary As #1: m$ = Space$(LOF(1)): Get 1, , m$: Close #1
x = StartDocPrinter(lhPrinter, 1, MyDocInfo)
x = StartPagePrinter(lhPrinter)
x = WritePrinter(lhPrinter, ByVal m$, Len(m$), lpcwritten)
x = EndPagePrinter(lhPrinter)
x = EndDocPrinter(lhPrinter)
x = ClosePrinter(lhPrinter)
End Function

ensuite reste juste a appeler la fonction avec le zpl dans ton fichier.
c'est assez rapide

fabrice
0
cs_ITALIA Messages postés 2169 Date d'inscription vendredi 20 avril 2001 Statut Membre Dernière intervention 30 juin 2009 9
12 mai 2005 à 10:06
Salut trabice,

J'utilise une Zebra et j'ai des gros soucis de lenteur d'impression avec la methode Printer.Print..
Je vais essayé ta methode du Module.
mais si le fichier txt envoyé contient du code ZPL, l'imprimante le traduira ? ou l'imprimera Texto ?

^XA
.....
.....
.....
^XZ

It@li@
0
Rejoignez-nous