KELP zebra TLP-2844 e GC420T
Enviado: 26 Fev 2015 15:01
Vlw Paiva... parabéns e obrigado por compartilhar.
[]s
[]s
Código: Selecionar todos
#include "hbgtinfo.ch"
#define TESTFILE "zebra.txt"
REQUEST HB_GT_WVT_DEFAULT
FUNCTION MAIN()
altd()
PrintMessage(Win_PrinterGetDefault())
RETURN Nil
STATIC FUNCTION PrintMessage(cPrinter)
SET CONS OFF
SET ALTE TO (TESTFILE)
SET ALTE ON
? 'N'
? 'ZT'
? 'D3'
? 'R0,0'
? 'A650,001,1,1,2,1,N," CORPO MAGICO"'
? 'A610,001,1,1,2,1,N,"BATA FLORES BCO "'
? 'B580,001,1,1,3,3,080,N,"0020167"'
? 'A495,001,1,1,2,2,N,"00201670016800"'
? 'A470,001,1,1,2,1,N,"ANNE FERNANDES"'
? 'A445,001,1,1,2,1,N,"------------------------------"'
? 'A400,001,1,1,2,1,N,"BATA FLORES BCO "'
? 'B370,001,1,1,3,3,080,N,"0020167"'
? 'A275,001,1,1,2,2,N,"00201670016800"'
? 'A235,001,1,1,2,2,N,"3 x 169,00"'
? 'P1'
SET ALTE OFF
SET ALTE TO
SET CONS ON
win_PrintFileRaw(cPrinter, TESTFILE, "Teste Impressora Zebra")
RETURN(.T.)
Código: Selecionar todos
static function _configura_etiqueta_zebra()
IF SUBSTR(upper(plpt_zebra),2,1) = [U] .or. ;
SUBSTR(upper(plpt_zebra),2,1) = [1] .or. ;
SUBSTR(upper(plpt_zebra),2,1) = [2] .or. ;
SUBSTR(upper(plpt_zebra),2,1) = [3]
IF SUBSTR(upper(plpt_zebra),2,1) = [1]
set device to printer
set printer to LPT1
set console off
else
IF SUBSTR(upper(plpt_zebra),2,1) = [2]
set device to printer
set printer to LPT2
set console off
else
IF SUBSTR(upper(plpt_zebra),2,1) = [U]
set device to printer
a = ppath + [\] +alltrim(pusuario) + '.txt'
set printer to &a
else
set device to printer
set printer to LPT3
set console off
endif
endif
endif
else
set device to printer
set console off
endif
cComando := "xa"+CHR(10)
@ PRow(), PCol() say cComando
set printer to
set device to screen
set console on
IF SUBSTR(upper(plpt_zebra),2,1) = [U]
pprt = tmenu
pprt = _obter_imp()
if empty(pprt)
pmsg = "ATENCAO 01 - NAO Existe Impressora ZEBRA definida, verifique ....:"+tmenu
ftempo(5)
select gmprod
return
endif
PrintFileRaw(pprt,a)
erase &a
endifCódigo: Selecionar todos
#include "hbgtinfo.ch"
#include "hbcompat.ch"
#define TESTFILE "zebra.txt"
#define CONFETQ "confetq.txt"
REQUEST HB_GT_WVT_DEFAULT
FUNCTION MAIN()
cImp_Zepra := Win_PrinterGetDefault()
altd()
_configura_etiqueta_zebra(cImp_Zepra)
PrintMessage(cImp_Zepra)
RETURN Nil
STATIC FUNCTION PrintMessage(cPrinter)
SET CONS OFF
SET ALTE TO (TESTFILE)
SET ALTE ON
? 'N'
? 'ZT'
? 'D3'
? 'R0,0'
? 'A650,001,1,1,2,1,N," CORPO MAGICO"'
? 'A610,001,1,1,2,1,N,"BATA FLORES BCO "'
? 'B580,001,1,1,3,3,080,N,"0020167"'
? 'A495,001,1,1,2,2,N,"00201670016800"'
? 'A470,001,1,1,2,1,N,"ANNE FERNANDES"'
? 'A445,001,1,1,2,1,N,"------------------------------"'
? 'A400,001,1,1,2,1,N,"BATA FLORES BCO "'
? 'B370,001,1,1,3,3,080,N,"0020167"'
? 'A275,001,1,1,2,2,N,"00201670016800"'
? 'A235,001,1,1,2,2,N,"3 x 169,00"'
? 'P1'
SET ALTE OFF
SET ALTE TO
SET CONS ON
win_PrintFileRaw(cPrinter, TESTFILE, "Teste Impressora Zebra")
DeleteFile( TESTFILE )
RETURN(.T.)
********************************************************************************
/*
* Configurar a etiqueta antes de mandar imprimir
* 08/09/2016 - 08:22:39
*/
Static FUNCTION _configura_etiqueta_zebra(cImp_Zebra)
Set Printer to &CONFETQ
cComando := "xa"+CHR(10)
@ PRow(), PCol() say cComando
Set Printer to
Win_PrintFileRaw(cImp_Zebra,CONFETQ,'Configurando Etiqueta')
DeleteFile( CONFETQ )
Return .t.