Jump to content
Server Maintenance This Week. ×

Barcode4J wrapper implementation for Windows


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

Recommended Posts

Attached is a barebones Barcode4J implementation. This one requires Java, but runs without ScriptMaster. The solution automatically deploys the required JAR files to the temporary directory. 13 different barcode symbologies are supported (selected from symbology drop down menu). These include codabar, code128, code39, datamatrix, ean13, intl2of5,pdf417, postnet, upca, upce, royal-mail-cbc,

or usps4cb (USPS Intelligent Mail). The number input in barcode_text is converted into a PNG image and displayed when you click Generate Barcode. This could easily be altered to run on a Mac by altering the command line and paths. The DOS command used to generate the barcode is displayed also. There was a description of this here Link but it didn't include a standalone solution that self-installs the JARs.

Perhaps somebody could alter this so it runs on Macs and dumps the JARs and barcodes to temp. directory, and detects when barcode is ready (currently just pauses 2 sec).

The solution also uses nirc, so it can launch a DOS window without it displaying as the commands execute. nirc is deployed from a container into the temporary directory, along with the requisite jars.

If an error occurs it is displayed in a webviewer. The DOS command used to generate the barcode is displayed.

BarCode4J_Example.zip

Link to comment
Share on other sites

I am getting the following message when I try and generate a barcode. Doesn't seem to matter which barcode I choose.

The file barcode png could not be found is required to complete this operation. Then I get a second error messagde. The previous script could not be complete because of an error. Do you wish to continue with this script. I click continue and it returns me to where I started.

I am running windows 7 Enterprise. Standard install. Any suggestions as I would really like to see this work.

Link to comment
Share on other sites

Unfortunately, I don't have Windows 7 to test; it seems to work fine on Vista and XP. It sounds like it is unable to write to the temporary folder, thus the barcode file does not exist? When you paste the DOS command shown into a command Window, what does it do?

I did alter my ScriptMaster version (requires free ScriptMaster plugin), so it supports all barcodes. A copy is attached. It might be good to update this to handle abstractbarcode type.

SM_Barcodes_4to_zip.zip

Link to comment
Share on other sites

The following is the dos command copied from the program with the result as run from a dos window in Win 7.

C:UsersDoug Hampton>C:/Users/Doug Hampton/AppData/Local/Temp/S10/nircmd.exe" e

xecmd java -cp "C:/Users/Doug Hampton/AppData/Local/Temp/S10/barcode4j.jar;C:/Us

ers/Doug Hampton/AppData/Local/Temp/S10/avalon-framework-4.1.5.jar;C:/Users/Doug

Hampton/AppData/Local/Temp/S10/commons-cli-1.0.jar" org.krysalis.barcode4j.cli.

Main -o "C:/Users/Doug Hampton/AppData/Local/Temp/S10/barcode.png" -f png --bw -

d 600 -s code128 "17891222228" 2>c:stdout.txt

'C:/Users/Doug' is not recognized as an internal or external command,

operable program or batch file.

Let me know if you need any more info.

Doug

Link to comment
Share on other sites

I made a change to this but it's on my computer at home. I think the problem is exporting standard error to C: -- I should have exported that file to temporary directory as well. I also added a VBS call to run the command, which also hides the DOS Window. Through VBScript, it's also possible to tell when a DOS command terminates, by using | CLIP to copy clipboard back into Filemaker, rather than using a fixed time delay.

Also, you need to precede the DOS command with a " because the path has spaces in it; try it again that way and see what it does.

Link to comment
Share on other sites

There is a quote mark at the start of the DOS command. I must have cut it off when I copied the result. Sorry about that. Tried your other suggestions and still could not get it to work. But possible that is my fault as my knowledge of Dos is limited.

Perhaps when you get home you could post the file with the changes and I could see if that works.

I also have a FileMaker app that I am working on very similar to this. I am using a shell script to produce the the encoding for the barcode and using the font to produce the barcode. It also does address verification and returns the address in the standard that the USPS encourages. If the address can not be verified it marks it as bad and then you can deal with it. Still some more work on it to do. I could not get that same concept to work on windows. Again it is probably my lack of knowledge.

Doug

Doug

Link to comment
Share on other sites

Attached is the revised version; standard out file is now written to temporary directory instead of C:, if that was the cause of the error.

I also included a VBScript version (second button/script). It uses the clipboard to pass the DOS command's standard output and error right back into FM, so that FM knows when the command is completed. The | CLIP DOS command is used to pipe the output to the clipboard for FM processing. Please advise if this runs correctly on Win7.

Also, did you try the ScriptMaster wrapper I posted? It should run on Win or Mac with SM plugin.

BarCode4J_Example.zip

Link to comment
Share on other sites

The last file that you put up for download worked fine in Windows 7. Both of the buttons worked correctly and as expected.

I could get the other file with 360 Works plugin to work if I ran their file first before I ran yours. When I tried to put the code in the startup script according to their directions it did not load correctly.

Know to try and understand what you did and how you did it is the next step for me.

Thanks for you time and help.

Doug

Edited by Guest
Link to comment
Share on other sites

This topic is 4951 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.