2D bar code printing

2D bar code printing

Postby cdmmaui » Thu Sep 15, 2011 8: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
User avatar
cdmmaui
 
Posts: 689
Joined: Fri Oct 28, 2005 9:53 am
Location: Houston ∙ Chicago ∙ Los Angeles ∙ Miami ∙ London ∙ Hong Kong

Re: 2D bar code printing

Postby Gale FORd » 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: Select all  Expand view

#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

Gale FORd
 
Posts: 663
Joined: Mon Dec 05, 2005 11:22 pm
Location: Houston

Re: 2D bar code printing

Postby Enrico Maria Giordano » Fri Sep 16, 2011 8: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
User avatar
Enrico Maria Giordano
 
Posts: 8712
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 96 guests