Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 3544 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies
Posted

Had to share this one with everyone, as I recently spent a lot of time looking for a method to generate 2D barcodes, and came across a free solution that's pretty easy to implement (in my eyes) courtesy of the Barcode4J project. Here Goes:

1) Download barcode4J-2.0 from sourceforge

2) Extract .tar with double-click

3) Move extracted folder to root, change name to "barcode"

4) download Apache-Ant-1.8.1

5) rename Apache folder to "ant" and place in root directory

6) Using Terminal, navigate to "Barcode" directory, and type "ant"

System should spew a bunch of text out as it builds the necessary files and say "Build successful" This literally took 3 seconds on my home computer

7) Insert into Filemaker a script that calls an apple script as follows:

tell application "FileMaker Pro"

set part1 to cell "[Field Name]" of current record

[repeat as many times as necessary]

end tell

try

do shell script "java -cp /barcode/build/barcode4j.jar:/barcode/lib/avalon-framework-4.2.0.jar:/barcode/lib/commons-cli-1.0.jar org.krysalis.barcode4j.cli.Main -o barcodeforfilemaker.png -f png --bw -d 300 -s datamatrix "" & part1 & """

end try

EXPLAINED:

This script sets variables (parts1.-..) to match fields from FileMaker's current layout. It then calls a shell script as defined by Barcode4J, specifies the output file name "-o" as barcodeforfilemaker.png, specifies the PNG format, resolution of 300dpi, datamatrix format and then inserts the data to create the barcode. You can use the "&" to concatenate multiple fields, which I have done in my solution.

The script as defined in FileMaker should include elements to commit record/request, perform applescript as above, go to field, insert picture.

For reference: here is a command line that works to generate a code generically.

COMMAND LINE:

java -cp /barcode/build/barcode4j.jar:/barcode/lib/avalon-framework-4.2.0.jar:/barcode/lib/commons-cli-1.0.jar org.krysalis.barcode4j.cli.Main -o barcode.png -f png --bw -d 600 -s datamatrix "DATA TO MAKE BARCODE WITH GOES HERE"

I have implemented this on a system that generates 2D barcodes for name badges at conferences. A "Bulk-Assign" script systematically goes through the database and creates the barcodes one-by-one and inserts them into container fields with each record. I should mention that this method as written would only work on a Mac, but once I figured it out, it literally only took about an hour to get it running in full. Hope this helps someone else out there, and keeps them from having to buy a $500 plugin or font that you can't manipulate as easily as you can a image file.

Best of luck!

  • 9 months later...
  • 3 years later...
  • Newbies
Posted

1) Download barcode4J-2.0 from sourceforge
2) Extract .tar with double-click
3) Move extracted folder to root, change name to "barcode"
4) download Apache-Ant-1.8.1
5) rename Apache folder to "ant" and place in root directory
6) Using Terminal, navigate to "Barcode" directory, and type "ant"

 

I open terminal, i change my dir to root, I write ant on terminal but nothing appen

Osx Yosemithe

 

Mario

This topic is 3544 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.