Jump to content
Sign in to follow this  
Bob Minteer

Reading Bar Codes with zxing Java Library

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.  

 

regards...

 

Bob Minteer

 

Share this post


Link to post
Share on other sites

Bob

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

Share this post


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.

 

regards...

 

Bob Minteer

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • 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
      Hello
      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.
      EikonsysOne_CFDi_52.zip
    • 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?
  • Who Viewed the Topic

    3 members have viewed this topic:
    moriya0238  Pacotools  aztrix55 
×
×
  • Create New...

Important Information

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