Author | Topic: Barcode printing | |
---|---|---|
Jan Groenestein | Barcode printing on Fri, 25 Oct 2019 15:58:22 +0200 Gentlemen, We need to be able to print barcodes from our Xbase++ application. I'm told that you can do that by 'loading' a font that has 'barcode characters' such as free3of9.ttf, and then simply print those characters. However, how do I 'load' a font ? As far as I know Xbase++ only offers 8 font families (Times_small and such) and some modification options like Bold and Italic, and that's it. Is there a way to load other fonts ? Is there maybe a completely different way to tackle the problem ? Kind regards, Jan Groenestein | |
Carlos A Beling | Re: Barcode printing on Fri, 25 Oct 2019 12:44:17 -0300 Hi jan: Good day. I attached the functions that I use. Please feel free to use it and if you made correctons or made it best please let me to know. Fraternally Beling On 25/10/2019 10:58, Jan Groenestein wrote: > Gentlemen, > > We need to be able to print barcodes from our Xbase++ application. > I'm told that you can do that by 'loading' a font that has 'barcode > characters' such as free3of9.ttf, and then simply print those characters. > However, how do I 'load' a font ? As far as I know Xbase++ only offers 8 > font families (Times_small and such) and some modification options like > Bold and Italic, and that's it. > Is there a way to load other fonts ? > Is there maybe a completely different way to tackle the problem ? > > Kind regards, > Jan Groenestein Font.prg | |
Carlos A Beling | Re: Barcode printing on Fri, 25 Oct 2019 17:09:47 -0300 Hello Jan: good day. I found out a very old example of printing barcode with plain Xbase witten in germany. I attached it. May be it is useful for you. Fraternally Beling On 25/10/2019 10:58, Jan Groenestein wrote: > Gentlemen, > > We need to be able to print barcodes from our Xbase++ application. > I'm told that you can do that by 'loading' a font that has 'barcode > characters' such as free3of9.ttf, and then simply print those characters. > However, how do I 'load' a font ? As far as I know Xbase++ only offers 8 > font families (Times_small and such) and some modification options like > Bold and Italic, and that's it. > Is there a way to load other fonts ? > Is there maybe a completely different way to tackle the problem ? > > Kind regards, > Jan Groenestein Xpp_Barcode.zip | |
Jim Lee | Re: Barcode printing on Sat, 26 Oct 2019 07:11:12 +0200 hi, > I found out a very old example of printing barcode with plain Xbase > witten in germany. I attached it. May be it is useful for you. come to https://www.xbaseforum.de to finde more ... --- Diese E-Mail wurde von AVG auf Viren geprüft. http://www.avg.com | |
Jan Escholt | Re: Barcode printing on Sat, 26 Oct 2019 05:43:38 +0200 Jan, I use two ways to print barcodes: Just using XbpFont()/GraSetFont(), and sometimes painting them manually with GraLine(). The first one needs the font to be installed on the PC. The second is used when a color laser printer prints black barcodes by using all colors to mix them to black. If this doesn't work properly there are colored halos that can't be identified by barcode scanners. And keep in mind that just printing a value with a barcode font is only half of the job. Before that the checksum of the string has to be calculated and added to the string. Else you have a barcode but no scanner can identify that. Jan Am 25.10.2019 um 15:58 schrieb Jan Groenestein: > Gentlemen, > > We need to be able to print barcodes from our Xbase++ application. > I'm told that you can do that by 'loading' a font that has 'barcode > characters' such as free3of9.ttf, and then simply print those characters. > However, how do I 'load' a font ? As far as I know Xbase++ only offers 8 > font families (Times_small and such) and some modification options like > Bold and Italic, and that's it. > Is there a way to load other fonts ? > Is there maybe a completely different way to tackle the problem ? > > Kind regards, > Jan Groenestein | |
Jan Groenestein | Re: Barcode printing on Mon, 28 Oct 2019 10:24:39 +0100 Hi Jan, In principle I would prefer your method of painting barcodes manually, because our software must be able to run on many machines where we have limited control over available fonts. However, your Hb_xpp_barcode_ean13.prg appears to be written for a specific type of barcode. I would like to implement the Code 128 barcode standard. see : https://courses.cs.washington.edu/courses/cse370/01au/minirproject/BarcodeBattlers/barcodes.html The checksum calculation is quite different from what I see in your code. My questions are : - Can you confirm that the checksum calculation is different ? - If I read your mail correctly (and follow logic) the checksum must be calculated for the font-printing method as well ? Kind regards, Jan Groenestein Op 26-10-2019 om 05:43 schreef Jan Escholt: > Jan, > > I use two ways to print barcodes: Just using XbpFont()/GraSetFont(), and > sometimes painting them manually with GraLine(). > > The first one needs the font to be installed on the PC. The second is > used when a color laser printer prints black barcodes by using all > colors to mix them to black. If this doesn't work properly there are > colored halos that can't be identified by barcode scanners. > > And keep in mind that just printing a value with a barcode font is only > half of the job. Before that the checksum of the string has to be > calculated and added to the string. Else you have a barcode but no > scanner can identify that. > > Jan > > Am 25.10.2019 um 15:58 schrieb Jan Groenestein: >> Gentlemen, >> >> We need to be able to print barcodes from our Xbase++ application. >> I'm told that you can do that by 'loading' a font that has 'barcode >> characters' such as free3of9.ttf, and then simply print those characters. >> However, how do I 'load' a font ? As far as I know Xbase++ only offers >> 8 font families (Times_small and such) and some modification options >> like Bold and Italic, and that's it. >> Is there a way to load other fonts ? >> Is there maybe a completely different way to tackle the problem ? >> >> Kind regards, >> Jan Groenestein | |
Jan Escholt | Re: Barcode printing on Tue, 29 Oct 2019 20:06:27 +0100 Jan, Hb_xpp_barcode is not my class. And I don't use that. And yes, the checksum has to be calculated also when printing with XbpFont. Jan Am 28.10.2019 um 10:24 schrieb Jan Groenestein: > Hi Jan, > > In principle I would prefer your method of painting barcodes manually, > because our software must be able to run on many machines where we have > limited control over available fonts. However, your > Hb_xpp_barcode_ean13.prg appears to be written for a specific type of > barcode. I would like to implement the Code 128 barcode standard. > see : > https://courses.cs.washington.edu/courses/cse370/01au/minirproject/BarcodeBattlers/barcodes.html > > The checksum calculation is quite different from what I see in your code. > My questions are : > - Can you confirm that the checksum calculation is different ? > - If I read your mail correctly (and follow logic) the checksum must > be calculated for the font-printing method as well ? > > Kind regards, > Jan Groenestein > > Op 26-10-2019 om 05:43 schreef Jan Escholt: >> Jan, >> >> I use two ways to print barcodes: Just using XbpFont()/GraSetFont(), >> and sometimes painting them manually with GraLine(). >> >> The first one needs the font to be installed on the PC. The second is >> used when a color laser printer prints black barcodes by using all >> colors to mix them to black. If this doesn't work properly there are >> colored halos that can't be identified by barcode scanners. >> >> And keep in mind that just printing a value with a barcode font is >> only half of the job. Before that the checksum of the string has to be >> calculated and added to the string. Else you have a barcode but no >> scanner can identify that. >> >> Jan >> >> Am 25.10.2019 um 15:58 schrieb Jan Groenestein: >>> Gentlemen, >>> >>> We need to be able to print barcodes from our Xbase++ application. >>> I'm told that you can do that by 'loading' a font that has 'barcode >>> characters' such as free3of9.ttf, and then simply print those >>> characters. >>> However, how do I 'load' a font ? As far as I know Xbase++ only >>> offers 8 font families (Times_small and such) and some modification >>> options like Bold and Italic, and that's it. >>> Is there a way to load other fonts ? >>> Is there maybe a completely different way to tackle the problem ? >>> >>> Kind regards, >>> Jan Groenestein > | |
Jan Groenestein | Re: Barcode printing on Sat, 26 Oct 2019 09:30:00 +0200 Hi Carlos, Jim and Jan, I thank you all very much for your contributions. I'll try to implement them and test them, and will report back on the results. Thanks again ! Kind regards, Jan Groenestein Op 25-10-2019 om 15:58 schreef Jan Groenestein: > Gentlemen, > > We need to be able to print barcodes from our Xbase++ application. > I'm told that you can do that by 'loading' a font that has 'barcode > characters' such as free3of9.ttf, and then simply print those characters. > However, how do I 'load' a font ? As far as I know Xbase++ only offers 8 > font families (Times_small and such) and some modification options like > Bold and Italic, and that's it. > Is there a way to load other fonts ? > Is there maybe a completely different way to tackle the problem ? > > Kind regards, > Jan Groenestein | |
Jan Groenestein | Re: Barcode printing, solutions on Fri, 08 Nov 2019 18:03:24 +0100 Gentlemen, Problem solved, many thanks for your answers. Following the questions on barcode printing and on printing in general I completed the code for printing to labelprinters and for printing barcodes. Attached you will find sample code on how these problems were solved, to be used by anyone who is faced by these or similar problems. Mind you, no guarantees are given for this code, of course. Kind regards, Jan Groenestein Op 25-10-2019 om 15:58 schreef Jan Groenestein: > Gentlemen, > > We need to be able to print barcodes from our Xbase++ application. > I'm told that you can do that by 'loading' a font that has 'barcode > characters' such as free3of9.ttf, and then simply print those characters. > However, how do I 'load' a font ? As far as I know Xbase++ only offers 8 > font families (Times_small and such) and some modification options like > Bold and Italic, and that's it. > Is there a way to load other fonts ? > Is there maybe a completely different way to tackle the problem ? > > Kind regards, > Jan Groenestein SampleCode.prg |