Sample coding for barcode generating and printing

Code samples that you want to share with other people.

Sample coding for barcode generating and printing

Postby chrisocm » Thu May 21, 2015 11:33 pm

Hi all,

Does anybody have any samples on how to generate and print barcodes using CTD 2.1? Or any other CTD for that matter?

Thanks.

Regards,
Chris
chrisocm
 
Posts: 73
Joined: Sat Aug 15, 2009 3:03 pm

Re: Sample coding for barcode generating and printing

Postby Jeff @ PC Design » Sat May 23, 2015 11:32 am

Here's a good example of using Search to find something on the Forum if there is something, Chris. I just searched for 'barcode' and get a list of threads:
search.php?keywords=barcode
Jeff Luther/PC Design http://www.jeffluther.net/TD/
Image
Come join us at Dave Rabelink's "Team Dev. Community Forum".
All TD, TDMobile & SQLBase users welcome!
(http://tdforum.daverabelink.net/index.php)
Jeff @ PC Design
 
Posts: 206
Joined: Fri Feb 08, 2013 2:40 pm
Location: Palm Springs, California

Re: Sample coding for barcode generating and printing

Postby Scott » Sun May 24, 2015 10:58 pm

If you're talking about 1D, there's often a standard windows font (often free) that can be used in your report as text like any other font. You may need to surround the barcode with a stop/start character.

If the is packed or is a 2D variety, you'll need an external routine to calculate it as a picture and send the picture to the report. Most cost money. Here's a few free ones.
http://www.libdmtx.org/
http://datenfreihafen.org/projects/iec16022.html
http://datamatrixnet.sourceforge.net/
The attached sample is a Win32 form using a .Net .dll from the last url above done in TD 6.2.
You do not have the required permissions to view the files attached to this post.
Regards,
Scott
Scott
 
Posts: 87
Joined: Mon Nov 11, 2013 9:50 pm
Location: Sydney, Australia

Re: Sample coding for barcode generating and printing

Postby Scott » Wed May 27, 2015 4:16 pm

You do not have the required permissions to view the files attached to this post.
Regards,
Scott
Scott
 
Posts: 87
Joined: Mon Nov 11, 2013 9:50 pm
Location: Sydney, Australia

Re: Sample coding for barcode generating and printing

Postby chrisocm » Mon Jun 01, 2015 2:39 am

Thanks Jeff & Scott,

Will look into it. Able to generate the barcodes of variable length using the free barcode fonts. The next question is how does the wireless scanner pass the data back to the computer for processing. I guess I have to get a test unit to test it out.

Regards,
Chris
chrisocm
 
Posts: 73
Joined: Sat Aug 15, 2009 3:03 pm

Re: Sample coding for barcode generating and printing

Postby Scott » Mon Jun 01, 2015 5:00 pm

Not sure how your particular model works, but it's not uncommon for them to operate as a "keyboard wedge". i.e. it appears to the PC to be an ordinary keyboard & the data goes into standard data fields as if you typed it. This may require a driver, but particularly if by wireless you mean Bluetooth, it may just work strait out of the box. Otherwise, you'll be dealing with a custom API.
Regards,
Scott
Scott
 
Posts: 87
Joined: Mon Nov 11, 2013 9:50 pm
Location: Sydney, Australia

Re: Sample coding for barcode generating and printing

Postby chrisocm » Sat Feb 18, 2017 10:08 pm

Hi Scott,

I actually got a unit to try out the code 128B barcode. It works but I need to manually tab away from that field to enable the sam_validate. Any other way that I can incorporate the tab key in the barcode? Meaning when I scan the barcode, I want the system to automatically issue a tab key in the data field and the field will go to SAM_Validate.

Regards,
Chris
chrisocm
 
Posts: 73
Joined: Sat Aug 15, 2009 3:03 pm

Re: Sample coding for barcode generating and printing

Postby Scott » Sun Feb 26, 2017 4:12 pm

Hi Chris,

It's usually possible to configure your scanner to send a postamble on successful scan of a barcode. This could be a tab (0x11) or a CRLF combo (0x0D + 0x0A).
Regards,
Scott
Scott
 
Posts: 87
Joined: Mon Nov 11, 2013 9:50 pm
Location: Sydney, Australia

Re: Sample coding for barcode generating and printing

Postby chrisocm » Tue Feb 28, 2017 12:55 am

Thanks Scott
chrisocm
 
Posts: 73
Joined: Sat Aug 15, 2009 3:03 pm


Return to Samples

Who is online

Users browsing this forum: No registered users and 1 guest