Jump to content

QR codes


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

Recommended Posts

For those following the 'using QR codes to pass Safari address & parameters into FM GO' to launch it discussions, I have done a quick script to create the QR code and return the image to a container using the itextpdf library..(needs 5.02.jar)

Only have a 'Touch' not a 'Phone' so if anyone want to test this works it would be brilliant...


//QRimg(fm_content)

//2010_09_25 JR

//v1

//takes path and text from fm_content and returns image to container

//requires itextpdf.jar 5.02 from itextpdf.com



import java.awt.image.*

import com.itextpdf.text.*

import com.itextpdf.text.pdf.*



qr = new BarcodeQRCode(fm_content, 1, 1, null)

img = qr.createAwtImage(java.awt.Color.BLACK, java.awt.Color.WHITE)

int w = img.getWidth()

int h = img.getHeight()

bi = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB)

g2 = bi.createGraphics() 

g2.drawImage(img, 0, 0, w, h, null); 

g2.dispose()

return bi

  • Like 1
Link to comment
Share on other sites

  • 6 months later...
  • Newbies

Hi John,

I built this into an FM app I'm working on for a local museum that wants to add QR codes on the tags placed near the art objects, so that you can scan the code then have your browser take you to a web page with info about the object. Tested the QR code with an iPhone app called QRReader and it works well. Will test on an Android-based phone a little later and will post the results.

Link to comment
Share on other sites

  • 1 month later...

Just so happens I have updated my demo file this week

So here is is

Three layouts

FMP7 QR codes for use with Go

QR codes with a web address

Datamatrix code

John

Update

do not seem to be able to upload files

if anyone can fix this first then you can gladly have it.....

Link to comment
Share on other sites

For now here is the code


//DataMXimg(fm_content)

//2011_05_15 JR

//v1

//takes content from fm_content and returns image to container

//requires min itextpdf.jar 5.02 from itextpdf.com



import java.awt.image.*

import com.itextpdf.text.*

import com.itextpdf.text.pdf.*



qr = new BarcodeDatamatrix()

qr.generate(fm_content)

img = qr.createAwtImage(Color.BLACK, Color.WHITE)

int w = img.getWidth()

int h = img.getHeight()

bi = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB)

g2 = bi.createGraphics()

g2.drawImage(img, 0, 0, w, h, null)

g2.dispose()

return bi



Link to comment
Share on other sites

Personally I love the zxing library to do that for me. http://code.google.com/p/zxing/

It can also read an image with a QR code in it (even when it is a picture of a building with a QR code on it) and returns the value of the QR code.

Andries

Link to comment
Share on other sites

  • 3 years later...
  • Newbies

Personally I love the zxing library to do that for me. http://code.google.com/p/zxing/

It can also read an image with a QR code in it (even when it is a picture of a building with a QR code on it) and returns the value of the QR code.

Andries

 

 

thanks andries, i have used zxing library for barcode, works great for me. and i am also testing other projects: how to create colorful qr code in java.

Link to comment
Share on other sites

  • 4 months later...

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