Skip to main content
May 3, 2008
Question

CFScript and Initializing Java

  • May 3, 2008
  • 1 reply
  • 410 views
Hello, I am currently generating barcodes successfully in CF 7. However, I'm trying to simply point the RBarcode reader (from java4less.com) to a .jpg and read the file. If anyone can help, it would be GREATLY appreciated.

For the required JAR files, go to:
http://www.java4less.com/vision/RVisionJava.zip (READER)
http://www.java4less.com/rbard10.zip (GENERATOR)

Someone has successfully done what I'm trying to do - but has done so in CF 8 (I'm using CF7). To see his code:
http://www.stillnetstudios.com/2007/12/15/2d-barcodes-coldfusion
    This topic has been closed for replies.

    1 reply

    May 3, 2008
    I think I'm pretty close... but I keep getting the list of methods back from the cfscript:

    array
    - 1
    - methods
    toString (returns java.lang.String)
    getValue (returns java.lang.String)
    setValue (returns void)
    getX (returns int)
    getY (returns int)
    setX (returns void)
    setY (returns void)
    getSymbology (returns int)
    setSymbology (returns void)
    hashCode (returns int)
    getClass (returns java.lang.Class)
    wait (returns void)
    wait (returns void)
    wait (returns void)
    equals (returns boolean)
    notify (returns void)
    notifyAll (returns void)
    Inspiring
    May 3, 2008
    aparsons wrote:

    ...
    RImageData = myReader.scan(myImage.init(imageIO.read(inFile)));
    return RImageData;

    I think I'm pretty close... but I keep getting the list of methods back from the cfscript:


    That is because scan() returns an array of BarCodeData objects. You have to loop through the array of java objects and call the desired methods to extract the data you need. If you look at the code for 2DBarCode_j4l.cfc, that is what the author is doing inside the readFromImage() function. He extracts the data and converts it to CF objects for easier use. Since the CFC is already written, have you tried adapting it to work with MX7?

    BTW, you should VAR scope all function local variables to prevent thread/scope conflicts.