December 16, 201411 yr 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
December 17, 201411 yr 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()
December 20, 201411 yr Author 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
Create an account or sign in to comment