Jump to content

Reading Bar Codes with zxing Java Library

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

Recommended Posts

Has anyone had success using the zxing library to read/decode bar codes with ScriptMaster ?   I generate them just fine using the Barcode4J library.


I think I am having dependency issues (take a pill...) and not much forward momentum getting it to work.


Examples, suggestions or commiseration are greatly accepted.  




Bob Minteer


Link to post
Share on other sites


this works for QR codes definitely and most of the other supported types at https://github.com/zxing/zxing/, I think I have other bit of code too... just needs the javase-nn.jar and the code-nn.jar

I am using 2.3 with Java  6 at the moment


I pass is the name of a container field in the table I run this in as fm_container

import com.google.zxing.*
import com.google.zxing.client.j2se.*
import com.google.zxing.common.*
import javax.imageio.ImageIO

barCodeInputStream = fmpro.getContainerStream (fm_container)
barCodeBufferedImage = ImageIO.read(barCodeInputStream)

LuminanceSource source = new BufferedImageLuminanceSource(barCodeBufferedImage)
bitmap = new BinaryBitmap(new HybridBinarizer(source)) 
reader = new MultiFormatReader()
try {
	result = reader.decode(bitmap)  
} catch ( Exception e) {
	return e
return result.getText()
  • Like 1
Link to post
Share on other sites

Many thanks John!  


That has put me back on track.   


I am attempting to read barcodes from PDF's.


While working through this, I kept testing and tweaking... to no avail.     


Then it occured to me, "Doh!  I have to convert the PDF's to images like tiff before zxing will do the decoding".


Your code works great on images with EAN128, Code39 and QR.


Now I am on to working out conversion via the Apache PDFBox library so that I am passing an image to zxing library.




Bob Minteer

Link to post
Share on other sites

This topic is 2170 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
  • Similar Content

    • By mat101010
      After moving the .fmx64 plugin file to the Extensions folder, FileMaker Pro (v18.0.3 and Windows 10) shows a message saying "Unable to launch plug-in child process JVM". This is happening for both the Email plugin and the FTPeek plugin. 
    • By Mr. Scott
      When I fired up FMPA 18 the first time with plugins installed, I received an alert for a number of well-known commercial plugins as well as every one of the plugins created with ScriptMaster Advanced.
      Will a near-future release of ScriptMaster Advanced allow us to create "digitally signed" plugins?
      If so, ETA or a workaround?
      Thanks in advance,
      - - Scott

    • By Stickybeak
      I am evaluating 360works email plugin and when getting messages from an office365 server I get the following error "java.lang.ArrayIndexOutOfBoundsException: -99"...If I click OK it reduces to "98" but then increases: I assume its retrieving messages and this is the count.
      Any ideas?

    • By Ibrahim Bittar
      Yesterday I created a plugin with ScriptMaster 5.1. It only has 5 functions.
      In most computers it shows the "Preparing Plugin for First use Dialog", sometimes it takes several minutes but finally it ends and the plugin starts working as expected. However, in 20-25% of the computers I've installed it (via Install Plug-In script step) I'm getting initialization errors. The plugin shows unchecked and it fails to initialize if I try to activate the check box.
      I've looked everywhere to see what I can delete in order to have the "Preparing Plugin...." dialog again to see if I am luckier this time but nothing seems to help and my users are starting to get angry.
      Please find attached the plugin I made (Win32, Win64 and Mac) and some log files i could find.
      Hope you can help me.
    • By bigitinc
      Are any of the announced distribution/release changes at https://java.com/en/download/release_notice.jsp going to impact our ability to use our plugins made with ScriptMaster?
  • Create New...

Important Information

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