Hello
Does anyone have a function that will convert a string to barcode 128? I download the
free font CODE128, but now I need to calculate the value to feed it.
I want to avoid the need to purchase from ID Automation.
Thank You
Tom
Hello
Does anyone have a function that will convert a string to barcode 128? I download the
free font CODE128, but now I need to calculate the value to feed it.
I want to avoid the need to purchase from ID Automation.
Thank You
Tom
Hello Brad,
I work with "IDAutomationNativeFontEncoder64.dll" in ...\system32
So I declare :
FUNCTION Long IDAutomation_Universal_C128(String Data2Encode, Ref Long ApplyTilde, Ref String Result, Ref Long iSize) &
Library "IDAutomationNativeFontEncoder64.dll" alias for "IDAutomation_Universal_C128"
And the function 'gf_...' :
string result
result = space(250)
long rtn, iSize, iTilde = 1
rtn = IDAutomation_Universal_C128(d2e, iTilde, result, isize)
// rtn is not a reliable result code in the 2012-10-22 version of this dll, so we ignore it
result = left(result, iSize)
return result
I did what you said but I receive the error :
"Bad runtime function reference in function gf_..."
Could you help me please ?
KR
Alain
it appears that the font you downloaded originally came from the grandzebu site.
The site also provides VB code to show you how to calculate the check digits - and provides a pretty good reference on how it works.
https://grandzebu.net/informatique/codbar-en/code128.htm
this is relatively simple, and could be generated in PB if you didn't want to bother with a dll.
You'll need to find source code based on which font you've downloaded. Barcode fonts aren't interchangeable.
Where did you download the font from, and are there any source code examples for generating the strings the font needs?
We've been using the ID Automation Universal Font Encoder for 10+ years, it has a large number of supported barcode types, and the DLL is easy to use. The cost & time spent trying to roll your own functions for varying barcodes would probably be higher than the cost of buying a pre-built solution. Our purchase of the font encoder has more than paid for itself. It's a one time cost, for one developer, and there's no cost to distribute the font files. What's not to like about that?
Hi Tom
I think you will have to research this yourself. I'm sure hat the documentation for the font you have installed combined with this:
https://en.wikipedia.org/wiki/Code_128
Would give you a solution...
Cheers
David
You are right ... I can't use 64bit dll with IDE (32bit)
So I used IdAutomationFontEncoder.dll (32bit) and I was compiling my project in 32 bit
But I placed IdAutomationFontEncoder.dll (32bit) in ... \System32
Or it must be placed in ...\Syswow64 and registered with ...\Syswow64\Regsvr32
Then it works as well in IDE than with .exe
"Oufti :-)"
Thanks