daknetworks.com

You are here: Blog Generating Barcodes - Code 39 and Code 128

Generating Barcodes - Code 39 and Code 128

Generating barcodes is somewhat easy but can get complicated for various reasons. Before we get to it, know that there are several types of barcode formats. We're focusing on linear barcodes, CODE 39 and CODE 128.

Code 39 (or Code 3 of 9)

Code 39 is simple. In short, surround the text with asterisks and change the font to 3-OF-9.

  • -install the Code39 font here: http://www.fonts2u.com/3-of-9-barcode.font ([c] CAIL v1.0 - 1993)
  • -install the font.
  • -reboot the computer (this is required).
  • -in WORD:
    • type what you want in a barcode (ie ABC123).
    • surround it with asterisks (ie *ABC123*).
    • change the font to 3-OF-9.
    • that should do it!
  • -in EXCEL
    • type what you want in a barcode in column A: (ie ABC123)
    • create a simple formula (use the CONCAT function) in column B that surrounds the text with asterisks: (ie *ABC123*)
    • create a simple formula in column C that simply mirrors column B.
    • change the font on column C to font 3-OF-9.
    • that should do it!
  • -in FILEMAKER
    • create a field called INFO as text.
    • create a field called INFO_BARCODE as calculation.
    • create a calculation that concats the INFO field surrounded by asterisks ("*" & INFO & "*").
    • put the fields on the layout.
    • on the INFO_BARCODE field, change the font to 3-OF-9.

Code 128

Code128 is a little more challenging than Code39. You would want to use Code128 when you need a compact barcode in a small space where Code39 will not fit.

The challenging item with Code128 is that you need to translate what you want in a barcode into a barcode-string that contains accent letters.

  • -install the Code128 font here: http://www.dafont.com/code-128.font ([c] GRANDZABU v1.2 - 2003)
  • -install the font.
  • -reboot the computer (this is required).
  • -go to an online barcode-string-builder, here: http://www.jtbarton.com/Barcodes/BarcodeStringBuilderExample.aspx
  • -type what you want barcoded.
  • -click TO CODE 128
  • -in WORD:
    • paste in the results.
    • change the font to CODE-128.
    • that should do it!
  • -in EXCEL:
  • -in FILEMAKER
    • download the FILEMAKER plugin here: http://downloads.idautomation.com/IDAutomationFMPlugin.zip
    • unzip the download.
    • close FILEMAKER.
    • copy the plugin file called IDAutomation.fmx and paste it in C:\Program Files\FileMaker\FileMaker Pro\Extensions (adjust the path to your version accordingly).
    • open FILEMAKER.
    • create a field called INFO as text.
    • create a field called INFO_BARCODE as calculation.
    • create a calculation that returns the INFO field as a barcode string. Use the custom function like so: IDAu_Code128( INFO )
    • the result should be calculated as TEXT (not NUMBER).
    • put the fields on the layout.
    • click FORMAT > FONTS > CONFIGURE/MORE-FONTS (at the top menu).
    • find CODE-128 (on the left-hand column).
    • click MOVE.
    • click OK.
    • select the INFO_BARCODE field.
    • hold CTRL and ALT keys (on your keyboard).
    • select the font to Code-128 (at the top).
    • that should do it!

NOTES:

For whatever reason, I struggled do this for days. Again, I found a bunch of misinformation or confusing documents that lead me astray. Even different/newer versions of the fonts were red herrings and did not produce correct results.

With the correct fonts, installed correctly, with the correct plugins, installed correctly, with the correct calculations, calculating correctly and the fonts configured correctly, I was finally able to do this.

Contact Dak Networks

We are not taking on new clients at this time.