Help with Bar Codes

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
MGOLDFARB
Posts: 71
Joined: Thu Jun 21, 2012 7:46 am

Help with Bar Codes

Post by MGOLDFARB »

Hi. My original clipper (from 20+ years ago) applications used a a library that printed zip+4 (U.S. zip code bar coding) on the invoice. The library file is clipbar5.lib. I do not have the source code.

Is there a way to link a .LIB file into an HMG IDE application, or does anyone know of a compatible library that can print bar codes?

Thanks.

Mark
User avatar
danielmaximiliano
Posts: 2763
Joined: Fri Apr 09, 2010 4:53 pm
DBs Used: DBF
Location: Argentina
Contact:

Re: Help with Bar Codes

Post by danielmaximiliano »

MGOLDFARB wrote:Hi. My original clipper (from 20+ years ago) applications used a a library that printed zip+4 (U.S. zip code bar coding) on the invoice. The library file is clipbar5.lib. I do not have the source code.

Is there a way to link a .LIB file into an HMG IDE application, or does anyone know of a compatible library that can print bar codes?

Thanks.

Mark
Hola Mark:
This Found / encontre esto : http://pe.usps.gov/cpim/ftp/pubs/Pub63/pub63.pdf

Page 8
To automate this process, all Postal Service FSMs were equipped
with barcode readers to enhance the speed, accuracy, and efficiency
of processing. The barcode readers ignore all alphanumeric
printing and read only POSTNET barcodes
pub63.jpg
pub63.jpg (35.01 KiB) Viewed 4327 times
Zint sourcecode :
http://sourceforge.net/projects/zint/fi ... z/download
Zint is able to encode data in the following formats:

Code 11, Standard Code 2 of 5, IATA Code 2 of 5, Industrial Code 2 of 5,
Interleaved Code 2 of 5, Code 2 of 5 Data Logic, ITF-14, Deutche Post
Leitcode, Deutche Post Identcode, UPC-A, UPC-E, EAN-2, EAN-5, EAN-8,
EAN-13, UK Plessey, MSI Plessey, Telepen Alpha, Telepen Numeric, Code 39,
Extended Code 39, Code 93, PZN, Code 23, LOGMARS, Codabar, Pharmacode, Code
128, EAN-128, NVE-18, Code 16k, PDF417, MicroPDF417, Two-Track Pharmacode,
PostNet, PLANET, Australia Post 4-State Symbols, RM4SCC, USPS OneCode, GS1
DataBar, DataBar-14, DataBar Limited, DataBar Extended, DataBar Stacked,
Composite Symbology, Data Matrix, QR Code, Maxicode, Aztec Code, EAN-13,
Micro QR, Korea Post Barcode, HIBC Code 128, HIBC Code 39, HIBC Data Matrix,
HIBC PDF417, HIBC MicroPDF417, HIBC QR Code, HIBC Aztec Code, Japanese Postal
Code, Code 49, Channel Code, Code One, Grid Matrix, FIM and Flattermarken.
seria necesario crear una envoltura o llamadas a funciones en :
would be necessary to create an envelope or function call in :


E:\Temp\zint-2.4.3\backend\postal.c
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
Telegram invitation https://t.me/HMGWorkspace
User avatar
danielmaximiliano
Posts: 2763
Joined: Fri Apr 09, 2010 4:53 pm
DBs Used: DBF
Location: Argentina
Contact:

Re: Help with Bar Codes

Post by danielmaximiliano »

Puede usted enviar un Zip code como ejemplo para probar, si es posible subir una imagen real de un correo por una oficina postal.
tambien parte del codigo que utilizaba con Clipbar5.lib
also part of the code that use to Clipbar5.lib

Can you send a Zip code as an example to prove, if possible upload a real picture of a mail by post office.
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
Telegram invitation https://t.me/HMGWorkspace
MGOLDFARB
Posts: 71
Joined: Thu Jun 21, 2012 7:46 am

Re: Help with Bar Codes

Post by MGOLDFARB »

Hi. Thank you for the responses. I took a break from this for a week+, and am now just getting back to solve this problem.

I see that Marek developed code in 2008. Does anyone know if this code can easily be converted to create the USPS bar code required.

I have attached a sample of what I am looking to do (above the mailing address on the invoice).

Thanks.

Mark
Attachments
Untitled.jpg
Untitled.jpg (29.04 KiB) Viewed 4206 times
User avatar
mol
Posts: 3825
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: Help with Bar Codes

Post by mol »

What is a type/name of this barcode?
Maybe try to download software from this site:
http://usps-postnet-barcode-font.winsite.com
Install fonts and simply print barcode by selecting right font.

I'm printing code39 in this way and everything works fine.
MGOLDFARB
Posts: 71
Joined: Thu Jun 21, 2012 7:46 am

Re: Help with Bar Codes

Post by MGOLDFARB »

Thanks. I downloaded the demo. This is the first time I am changing fonts while printing in HMG IDE, and I think I am doing something wrong.

When I am in word and I change tot he PrecisionID font, the barcode comes out correctly.

In my HMG code, I am changing to the font, and it comes out as the numbers. My guess is that my syntax for changing the font is wrong. Any ideas?

This is the line from my code. zip is the variable with the zip code.
@ 65,10 print DATA zip FONT 'PrecisionID Postnet DEMO Regular'

Thanks.

mark
User avatar
mol
Posts: 3825
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: Help with Bar Codes

Post by mol »

I'm printing in this way, and works OK:

Code: Select all

@ RowOffset + 51, 198 PRINT "*" + alltrim(cKlient) + "*";
			FONT "FREE 3 OF 9 Extended Regular" ;
			SIZE 24 ;
			COLOR BLACK ;
			RIGHT
You can also automatize installation of font:

Code: Select all

		if !File(GetWindowsFolder()+"\fonts\FRE3OF9X.TTF")
			FileCopy(FolderProgramu+"\FRE3OF9X.TTF", GetWindowsFolder()+"\fonts\FRE3OF9X.TTF")
			RegistryWrite( "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts\FREE 3 OF 9 Extended Regular" , "FRE3OF9X.TTF"  )
		endif
There was an example how to load font temporarily without installation, but I'm not sure if these functions works OK:

Code: Select all

#define FR_PRIVATE 0x10
#define FR_NOT_ENUM 0x20
DECLARE DLL_TYPE_INT AddFontResourceEx( DLL_TYPE_LPCTSTR lpszFileName, DLL_TYPE_DWORD fl, DLL_TYPE_LPVOID pdv) IN GDI32.DLL

function AddFont(cFontName)
local nRet := AddFontResourceEx( cFontName, FR_PRIVATE + FR_NOT_ENUM, 0 )
return NIL
and remove font:

Code: Select all

function RemoveFont(cFontName)
local nRet := RemoveFontResourceEx( cFontName, FR_PRIVATE + FR_NOT_ENUM, 0 )
return NIL
Regards, Marek
User avatar
danielmaximiliano
Posts: 2763
Joined: Fri Apr 09, 2010 4:53 pm
DBs Used: DBF
Location: Argentina
Contact:

Re: Help with Bar Codes

Post by danielmaximiliano »

MGOLDFARB wrote:Thanks. I downloaded the demo. This is the first time I am changing fonts while printing in HMG IDE, and I think I am doing something wrong.

When I am in word and I change tot he PrecisionID font, the barcode comes out correctly.

In my HMG code, I am changing to the font, and it comes out as the numbers. My guess is that my syntax for changing the font is wrong. Any ideas?

This is the line from my code. zip is the variable with the zip code.
@ 65,10 print DATA zip FONT 'PrecisionID Postnet DEMO Regular'

Thanks.

mark
Mark: I'm trying a Solucions for you
100072801 posnet.png
100072801 posnet.png (212 Bytes) Viewed 4188 times
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
Telegram invitation https://t.me/HMGWorkspace
MGOLDFARB
Posts: 71
Joined: Thu Jun 21, 2012 7:46 am

Re: Help with Bar Codes

Post by MGOLDFARB »

Thank you all. I got it to work!!

Mark
Post Reply