QR Code Generation in Java

Add the following jar into Class path and Lib folder in project

1.zxing-core-1.7.jar

2.qrgen-1.0.jar

3.zxing-j2se-1.7.jar

Source Code:

package javapages4all;

import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

import net.glxn.qrgen.QRCode;
import net.glxn.qrgen.image.ImageType;
public class QRCodeGeneration {

/**
* @param args
*/
public static void main(String[] args)
{
ByteArrayOutputStream out = QRCode.from(“Raja”).to(ImageType.PNG).stream();
try
{
/**
* set the output Image Location
*/
FileOutputStream fout = new FileOutputStream(new File(“/home/raja/Java/QR_Code_raja.JPG”));
fout.write(out.toByteArray());
fout.flush();
fout.close();

} catch (FileNotFoundException e)
{
e.printStackTrace();
} catch (IOException e)
{
e.printStackTrace();
}
}

}

 

Advertisements

4 thoughts on “QR Code Generation in Java

  1. Kolagen Wrocław June 19, 2013 at 5:12 pm Reply

    very interesting details you have observed , thanks for posting .

  2. Kolagen naturalny June 20, 2013 at 2:26 pm Reply

    Perfect just what I was looking for! .

  3. nocleg Międzywodzie June 20, 2013 at 3:01 pm Reply

    would love to incessantly get updated great blog ! .

  4. hotel Ustronie Morskie June 22, 2013 at 2:42 pm Reply

    I like this site its a master peace ! .

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: