FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour 2D bar code printing
Posts: 708
Joined: Fri Oct 28, 2005 09:53 AM
2D bar code printing
Posted: Thu Sep 15, 2011 08:22 PM

Hello, has anyone used 2D bar code library with FWH? If so, can you provide details?

*~*~*~*~*~*~*~*~*~*
Darrell Ortiz
CDM Software Solutions, Inc.
https://www.cdmsoft.com
Posts: 663
Joined: Mon Dec 05, 2005 11:22 PM
Re: 2D bar code printing
Posted: Thu Sep 15, 2011 11:03 PM
For printing I use a barcode font.

Here is a sample of my routine to check for barcode and install it if necessary.
In my program I just do CheckBarCode() if I want it installed automatically.

Code (fw): Select all Collapse
#define HKEY_LOCAL_MACHINE  (0x80000002)
Function CheckBarCode( lInstall )
   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)

Function InstallBarCode()
   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" )

   // need full path name of font to install.
   cFontDir          := '\\trg401\VOL0\Install\Fonts\'  

   cFontFile         := '3of9.ttf'

   oNameSpace        := oShellApplication:Namespace( cFontDir )
   oFont             := oNameSpace:ParseName( cFontFile )
   oFont:InvokeVerb("Install")
return nil
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: 2D bar code printing
Posted: Fri Sep 16, 2011 08:36 AM
cdmmaui wrote:Hello, has anyone used 2D bar code library with FWH? If so, can you provide details?


Try Cayetano's barlib library.

EMG

Continue the discussion