Page 1 of 1
CODE BAR ( por si alguien le sirve )
Posted: Thu Feb 25, 2016 7:11 pm
by sysctrl2
Amigos con este código de barra, hecho en FWH,
imprimimos código de barra con BARLIB.
Code: Select all
METHOD BuildCode() CLASS ScCodebar
local oPrn
local nAncho := 6 //medidas en cm
local nLargo := 3 //medidas en cm
PrnSetSize(nAncho*100, nLargo*100) //tamaño de la etiqueta
PRINT oPrn NAME "SysCtrl CodeBar" PREVIEW
define font oFont name "New Roman" size 0, -08 of oPrn
oPrn:lPrvModal := .t.
oPrn:SetPortrait()
::nRowStep := oPrn:nVertRes() / nLargo
::nColStep := oPrn:nHorzRes() / nAncho
if ! oPrn:setup()
return nil
endif
for i := 1 to nCuantos
PAGE
nRow := 1
nCol := .5
oPrn:Say(nRow, ::nColStep * nCol,cstr2(cCode_bar), oFont )
nRow += ::nRowStep*.5
@ nRow , ::nColStep*nCol code128 cstr2(cCode_bar) of oPrn SIZE 1
nRow += ::nRowStep
oPrn:Say( nRow, ::nColStep * nCol, cstr2(cNombre), oFont )
ENDPAGE
next
ENDPRINT
return nil
Por si a alguien le interesa ahi esta,
estas etiquetas se imprimen en una impresora ZEBRA,
saludos..
Re: CODE BAR ( por si alguien le sirve )
Posted: Fri Feb 26, 2016 1:14 pm
by karinha
César, és posible hacer un DEMO simples en formato *.zip con las librerias que usastes y poner en un link? Gracias, saludos.
Re: CODE BAR ( por si alguien le sirve )
Posted: Fri Feb 26, 2016 4:44 pm
by sysctrl2
Hola con mucho gusto, en un momento hago un test y lo subo aquí.
saludos..
Re: CODE BAR ( por si alguien le sirve )
Posted: Fri Feb 26, 2016 6:30 pm
by sysctrl2
Re: CODE BAR ( por si alguien le sirve )
Posted: Fri Mar 11, 2016 2:45 pm
by karinha
Muchas gracias Friend!! Excelente!
Re: CODE BAR ( por si alguien le sirve )
Posted: Fri Mar 11, 2016 4:27 pm
by karinha
César, mejoras:
Code: Select all
#include "fivewin.ch"
#include 'barcode.ch' // C:\FWH\INCLUDE
#DEFINE C_SIMPLE CHR( 39 )
#DEFINE c_simple CHR( 39 )
* +++++++++++++++++++++++++++++++++++++++++++++++++++++++ *
* *
* SysCtrl CodeBar + BARLIB DE Cayetano Gomez *
* *
* Sistema para imprimir codigos de barra *
* *
* fecha 26 de febrero 2016 *
* Autor: Cesar Cortes Cruz *
* CopyRight (c) SysCtrl Software 2003-2016 *
* +++++++++++++++++++++++++++++++++++++++++++++++++++++++ *
/* Nota:
esta aplicacion fue desarrollada para imprimir etiquetas de codigos de barra en impresora ZEBRA
importante que la impresora este calibrada por el programa ( ZebraDesigner )
toda duda o mejoras es bienvenido.
*/
static oCode, oWnd
static cCode_bar
static cNombre
static nCuantos
REQUEST HB_LANG_PT
REQUEST HB_CODEPAGE_PT850
function Principal()
PRIVATE SELF
SET DATE BRITISH
SET EPOCH TO 1950
SET CENTURY ON
SET SOFTSEEK OFF
SET WRAP ON
SETCANCEL( .F. )
SET CONFIRM OFF
SET DELETED ON
SET ESCAPE OFF
SET EXACT ON
SET EXCLUSIVE OFF
SET MULTIPLE OFF
HB_LANGSELECT( 'PT' ) // Default language is now Portuguese
HB_SETCODEPAGE( "PT850" )
IF IsExeRunning( cFileName( HB_ARGV( 0 ) ) )
QUIT
ENDIF
WITH OBJECT ScCodebar()
:New()
END OBJECT
return nil
CLASS ScCodebar
data oCon AS OBJECT
* ---------------------------------- *
* variables usadas en tprinter *
* ---------------------------------- *
data nRowStep, nColStep
Method New( oCon )
METHOD MakeWin()
METHOD MakeDlg()
METHOD BuildCode()
ENDCLASS
METHOD New() CLASS ScCodebar
::MakeWin()
Return nil
METHOD MakeWin() CLASS ScCodebar
local oMenu
local oSelf := Self
menu oMenu 2007
menuitem "MENU: SysCtrl CodeBar + ( BARLIB ) "
menu
menuitem "Codigo STD Ean13" action( oSelf:MakeDlg() )
SEPARATOR
menuitem "Salida del Sistema" action( Encerra( oWnd ) )
endmenu
endmenu
define window oWnd menu oMenu TITLE "SysCtrl CodeBar + Barlib of Cayetano Gomez"
activate window oWnd
return nil
METHOD MakeDlg() CLASS ScCodebar
local oGet := array( 10 )
local oBtn := array( 2 )
local oBrush
local oBox
local nRow := 10
cCode_bar := "A1A1A1A1A1A1"
cNombre := "NOMBRE DEL PRODUCTO"
nCuantos := 10 //cuantas etiquetas
DEFINE BRUSH oBrush color nrgb(255,255,255 )
DEFINE DIALOG oBox SIZE 600, 250 FONT WndMain():oFont TRANSPARENT BRUSH oBrush
oBox:lhelpicon := .F.
oBox:lTransparent := .t.
oBox:cTitle := "Impresion de etiquedas para productos ..."
@ nRow, 10 SAY "Clave de producto: " OF oBox pixel
@ nRow, 70 GET oGet[ 1] VAR cCode_bar of oBox SIZE 100, 10 ;
PICTURE "@!k" PIXEL UPDATE
nRow += 15
@ nRow, 10 SAY "Nombre: " OF oBox pixel
@ nRow, 70 GET oGet[ 2] VAR cNombre of oBox SIZE 230, 10 ;
PICTURE "@!k" PIXEL UPDATE
nRow += 15
@ nRow, 10 SAY "Cuantas etiquetas : ? " OF oBox pixel
@ nRow, 70 GET oGet[ 3] VAR nCuantos of oBox SIZE 30, 10 ;
PICTURE "999999" PIXEL UPDATE
@ 5.3, 6 BUTTON oBtn[1] PROMPT "&Aceptar" SIZE 48, 24 OF oBox ;
ACTION ( ::BuildCode(), oGet[1]:SetFocus() )
@ 5.3, 18 BUTTON oBtn[2] PROMPT "&Regresar" SIZE 48, 24 OF oBox ACTION ( oBox:end() ) CANCEL
ACTIVATE DIALOG oBox CENTERED
RETURN NIL
METHOD BuildCode() CLASS ScCodebar
local oPrn
local nAncho := 6 //medidas en cm
local nLargo := 3 //medidas en cm
local oFont
local nRow, nCol
PrnSetSize(nAncho*100, nLargo*100) //tamaño de la etiqueta
PRINT oPrn NAME "SysCtrl CodeBar" PREVIEW
define font oFont name "New Roman" size 0, -08 of oPrn
oPrn:lPrvModal := .t.
oPrn:SetPortrait()
::nRowStep := oPrn:nVertRes() / nLargo
::nColStep := oPrn:nHorzRes() / nAncho
if ! oPrn:setup()
return nil
endif
for i := 1 to nCuantos
PAGE
nRow := 1
nCol := .5
oPrn:Say(nRow, ::nColStep * nCol,cstr2(cCode_bar), oFont )
nRow += ::nRowStep*.5
@ nRow , ::nColStep*nCol code128 cstr2(cCode_bar) of oPrn SIZE 1
nRow += ::nRowStep
oPrn:Say( nRow, ::nColStep * nCol, cstr2(cNombre), oFont )
ENDPAGE
next
ENDPRINT
return nil
FUNCTION cStr2( nNum )
RETURN AllTrim( CStr( nNum ) )
FUNCTION ENCERRA( oWnd )
oWnd:End()
FreeResources()
SysRefresh()
RELEASE All
Hb_GCAll( .T. )
CLEAR MEMORY
PostQuitMessage( 0 )
__QUIT()
RETURN NIL
// FIN
Muchas gracias, saludos.
Re: CODE BAR ( por si alguien le sirve )
Posted: Fri Mar 11, 2016 7:20 pm
by sysctrl2
Bien amigo, gracias,
saludos..
Re: CODE BAR ( por si alguien le sirve )
Posted: Thu Mar 24, 2016 8:47 pm
by FranciscoA
Muchas gracias, Cesar. Voy a probarlo.
Saludos.
Re: CODE BAR ( por si alguien le sirve )
Posted: Thu Mar 31, 2016 1:26 am
by sysctrl2
ok. Francisco,
saludos.
Cesar.
Re: CODE BAR ( por si alguien le sirve )
Posted: Thu Apr 07, 2016 5:35 pm
by ACC69
sysctrl2 wrote:ok. Francisco,
saludos.
Cesar.
Gracias Cesar Cortez.
Saludos