FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour Impresi贸n de C贸digos de Barra con TPrinter
Posts: 470
Joined: Fri Feb 05, 2010 11:30 AM
Impresi贸n de C贸digos de Barra con TPrinter
Posted: Wed Jan 29, 2014 06:42 PM

Amigos,
estoy necesitando un peque帽o ejemplo de impresi贸n de c贸digos de barra con TPrinter
y no puedo encontrar nada.
Desde ya mil gracias!
Roberto

Univ@c I.S.I.
Desarrolladores de Software
http://www.elcolegioencasa.ar
Posts: 118
Joined: Fri Dec 20, 2013 10:39 AM
Re: Impresi贸n de C贸digos de Barra con TPrinter
Posted: Wed Jan 29, 2014 07:05 PM

Hola. P谩same un mail y te mando algo. Un saludo.

Windows 10 + FWH 20.08 + BCC 7.4 + Harbour 3.2.0 + PSPad 5.0.3
Posts: 470
Joined: Fri Feb 05, 2010 11:30 AM
Re: Impresi贸n de C贸digos de Barra con TPrinter
Posted: Wed Jan 29, 2014 07:13 PM

Eloy

r_viotti@hotmail.com
Muchas gracias!
Roberto

Univ@c I.S.I.
Desarrolladores de Software
http://www.elcolegioencasa.ar
Posts: 408
Joined: Fri Jan 29, 2010 08:14 PM
Re: Impresi贸n de C贸digos de Barra con TPrinter
Posted: Wed Feb 19, 2014 12:36 AM
Hola Roberto:

Defines primero el codigo de barras:
Code (fw): Select all Collapse
DEFINE FONT oFontB NAME "3 of 9 barcode" SIZE 0, -30 OF oPrn


Y luego para imprimir lo usas as铆:
Code (fw): Select all Collapse
oPrn:CmSay( Fila, Columna, "n煤mero para el c贸digo de barras",oFontB )


RECUERDA: Tienes que tener instalado de antemano en fuente de c贸digo de barras en windows.

Sino tienes las funciones que instalan el FONT para el c贸digo de barras, aqu铆 te dejo:
Code (fw): Select all Collapse
#DEFINE HKEY_LOCAL_MACHINE 聽(0x80000002)
/*------------------------------------------------------------------------------*/
Function CheckBarCode( lInstall )
/*------------------------------------------------------------------------------*/
/* Funcion principal para instalar el FONT 3of9Barcode en el sistema 聽 聽 聽 聽 聽 聽*/
/*------------------------------------------------------------------------------*/

聽 聽local cWinFontsFolder, cFontFile, oFontBarCode

聽 聽local cKey, oReg

聽 聽if lInstall == nil
聽 聽 聽 lInstall := .t.
聽 聽endif

聽 聽cKey := "Software\Microsoft\Windows NT\CurrentVersion\Fonts"
聽 聽oReg := TReg32():New( HKEY_LOCAL_MACHINE, cKey )

聽 聽// need name of font to install here
聽 聽cFontFile 聽:= oReg:Get( '3 of 9 Barcode (TrueType)' )

聽 聽oReg:Close()

聽 聽lIsBarcode := !empty( cFontFile )

聽 聽if .not. lIsBarCode .and. lInstall
聽 聽 聽 InstallBarCode()
聽 聽 聽 cFontFile 聽:= oReg:Get( '3 of 9 Barcode (TrueType)' )
聽 聽 聽 oReg:Close()
聽 聽 聽 lIsBarcode := !empty( cFontFile )
聽 聽endif

return( lIsBarcode)
/*------------------------------------------------------------------------------*/
STATIC Function InstallBarCode()
/*------------------------------------------------------------------------------*/
/* Funcion para instalar el FONT 3of9Barcode en el sistema 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽*/
/*------------------------------------------------------------------------------*/

聽 聽local cWindowsDir
聽 聽local oShellApplication
聽 聽local oShell
聽 聽local oShellFSO
聽 聽local cFontFile
聽 聽local cFontDir
聽 聽local cWinFontsFolder

聽 聽cWindowsDir := gete( "systemroot" )

聽 聽oShell = CreateObject("Shell.Application")
聽 聽oShellApplication := CreateObject( "Shell.Application" )
聽 聽oShell 聽 聽 聽 聽 聽 聽:= TOleAuto():New( "WScript.Shell" )
聽 聽oShellFSO 聽 聽 聽 聽 := TOleAuto():New( "Scripting.FileSystemObject" )

聽 聽/* cFontDir 聽 聽 聽 聽 聽:= 'c:\jll1109\psitaconta\fonts' 聽 聽 聽 聽 聽 聽 聽*/
聽 聽/* La carpeta origen del FONT en donde se ejecuta el programa + la */
聽 聽/* carpeta "FONTS" 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 */
聽 聽cFontDir 聽 := cFilePath( GetModuleFileName( GetInstance() ) ) + "Fonts"
聽 聽cFontFile 聽:= '3of9.ttf'
聽 聽oNameSpace := oShellApplication:Namespace( cFontDir )
聽 聽oFont 聽 聽 聽:= oNameSpace:ParseName( cFontFile )

聽 聽oFont:InvokeVerb("Install")

Return NIL


Un saludo
JLL
Libreria: FWH/FWH1109 + Harbour 5.8.2 + Borland C++ 5.8.2
Editor de Recursos: PellecC
ADA, OURXDBU
S.O: XP / Win 7 /Win10
Blog: http://javierlloris.blogspot.com.es/
e-mail: javierllorisprogramador@gmail.com
Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: Impresi贸n de C贸digos de Barra con TPrinter
Posted: Wed Feb 19, 2014 02:27 PM

JLL, son estas fuentes?

http://www.free-barcode-font.com/

Regards, saludos.

Jo茫o Santos - S茫o Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 408
Joined: Fri Jan 29, 2010 08:14 PM
Re: Impresi贸n de C贸digos de Barra con TPrinter
Posted: Wed Feb 19, 2014 04:01 PM
Hola karinha:

Aqu铆 tienes el fuente:

https://www.dropbox.com/s/878m0l2ey54vy7o/3OF9.rar

Un Saludo
JLL
Libreria: FWH/FWH1109 + Harbour 5.8.2 + Borland C++ 5.8.2
Editor de Recursos: PellecC
ADA, OURXDBU
S.O: XP / Win 7 /Win10
Blog: http://javierlloris.blogspot.com.es/
e-mail: javierllorisprogramador@gmail.com
Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: Impresi贸n de C贸digos de Barra con TPrinter
Posted: Wed Feb 19, 2014 04:15 PM

Muchas Gracias.

Jo茫o Santos - S茫o Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Impresi贸n de C贸digos de Barra con TPrinter
Posted: Sun Jul 30, 2017 11:20 PM

Alguien dispone de un font que funcione para imprimir EAN13, y que sea FREE?
No la encuentro

Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noci贸n del tiempo

El secreto de la felicidad no est谩 en hacer lo que te gusta, sino en que te guste lo que haces
Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: Impresi贸n de C贸digos de Barra con TPrinter
Posted: Mon Jul 31, 2017 12:16 PM
Jo茫o Santos - S茫o Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Impresi贸n de C贸digos de Barra con TPrinter
Posted: Mon Jul 31, 2017 12:44 PM

Joao conozco muy bien el gran trabajo de Cayetano y la libreria hb_zebra es otra posibilidad
Pero necesito para hacer unas pruebas un Font de Ean13
Gracias

Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noci贸n del tiempo

El secreto de la felicidad no est谩 en hacer lo que te gusta, sino en que te guste lo que haces
Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: Impresi贸n de C贸digos de Barra con TPrinter
Posted: Mon Jul 31, 2017 01:26 PM
Master, mira se 茅s esto?

https://www.4shared.com/rar/Mipq8u3_ei/FONTSWIN.html

Saludos.
Jo茫o Santos - S茫o Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Impresi贸n de C贸digos de Barra con TPrinter
Posted: Mon Jul 31, 2017 02:06 PM

Joao, gracias
Esto si puede servirme, mas tarde te lo confirmo

Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noci贸n del tiempo

El secreto de la felicidad no est谩 en hacer lo que te gusta, sino en que te guste lo que haces
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Impresi贸n de C贸digos de Barra con TPrinter
Posted: Mon Jul 31, 2017 02:20 PM

Joao, gracias
SOLUCIONADO

Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noci贸n del tiempo

El secreto de la felicidad no est谩 en hacer lo que te gusta, sino en que te guste lo que haces
Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: Impresi贸n de C贸digos de Barra con TPrinter
Posted: Mon Jul 31, 2017 05:33 PM

Maestro, va a poner un ejemplo?

Regards, saludos.

Jo茫o Santos - S茫o Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Impresi贸n de C贸digos de Barra con TPrinter
Posted: Mon Jul 31, 2017 06:07 PM
Por supuesto, aqui lo tienes
Con oPrn funciona igual que en un SAY, seleccionando ese font

Code (fw): Select all Collapse
#include "Fivewin.ch"

Function Main()

聽 聽local oWnd
聽 聽local oBar
聽 聽local oBtt1
聽 聽local oBtt2
聽 聽local oSay1
聽 聽local oSay2
聽 聽local oSay3
聽 聽local oFontText1
聽 聽local oFontBar
聽 聽local oFontBar1
聽 聽local cCode 聽 聽 聽:= "12345678"

聽 聽DEFINE FONT oFontText1 NAME "Arial" 聽 SIZE 聽00, -36
聽 聽DEFINE FONT oFontBar 聽 NAME "EAN-13" 聽SIZE 聽00, -36
聽 聽DEFINE FONT oFontBar1 聽NAME "EAN-13" 聽SIZE 聽20, -36

聽 聽DEFINE WINDOW oWnd FROM 0, 0 TO 660, 660 TITLE "Test" PIXEL
聽 聽 聽 oWnd:SetFont( oFontText1 )
聽 聽 聽 DEFINE BUTTONBAR oBar SIZE 48, 48 OF oWnd //2007
聽 聽 聽 DEFINE BUTTON oBtt1 PROMPT "Salir" OF oBar ACTION oWnd:End() TOOLTIP "Salir" CENTER
聽 聽 聽 oBtt1:nWidth := 96
聽 聽 聽 //oBar:aControls[ 1 ]:nWidth := 96
聽 聽 聽 @ 080, 100 SAY oSay1 PROMPT cCode PIXEL FONT oFontText1 SIZE 100, 40
聽 聽 聽 @ 160, 100 SAY oSay2 PROMPT cCode PIXEL FONT oFontBar 聽 SIZE 200, 60
聽 聽 聽 @ 240, 100 SAY oSay2 PROMPT cCode PIXEL FONT oFontBar1 聽SIZE 200, 60
聽 聽ACTIVATE WINDOW oWnd

聽 聽oFontText1:End()
聽 聽oFontBar:End()
聽 聽oFontBar1:End()

Return NIL


Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noci贸n del tiempo

El secreto de la felicidad no est谩 en hacer lo que te gusta, sino en que te guste lo que haces