Skip to content
This repository has been archived by the owner on Apr 29, 2021. It is now read-only.
/ QRGen Public archive
forked from kenglxn/QRGen

a simple QRCode generation api for java built on top ZXING

Notifications You must be signed in to change notification settings

OneSpan/QRGen

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

QRGen: a simple QRCode generation api for java built on top ZXING

Dependencies:

ZXING: http://code.google.com/p/zxing/

Get it:

QRGen is available from Maven Central Repository using the following dependency declaration:

Gradle:

dependencies {
    compile ("net.glxn:qrgen:1.3")
}

Maven:

<dependencies>
    <dependency>
        <groupId>net.glxn</groupId>
        <artifactId>qrgen</artifactId>
        <version>1.3</version>
    </dependency>
</dependencies>

Or you can clone and build yourself:

git clone git://github.com/kenglxn/QRGen.git
cd QRGen/
mvn clean install

Usage:

// get QR file from text using defaults
File file = QRCode.from("Hello World").file();

// get QR stream from text using defaults
ByteArrayOutputStream stream = QRCode.from("Hello World").stream();

// override the image type to be JPG
QRCode.from("Hello World").to(ImageType.JPG).file();
QRCode.from("Hello World").to(ImageType.JPG).stream();

// override image size to be 250x250
QRCode.from("Hello World").withSize(250, 250).file();
QRCode.from("Hello World").withSize(250, 250).stream();

// override size and image type
QRCode.from("Hello World").to(ImageType.GIF).withSize(250, 250).file();
QRCode.from("Hello World").to(ImageType.GIF).withSize(250, 250).stream();

// supply own outputstream
QRCode.from("Hello World").to(ImageType.PNG).writeTo(outputStream);

// supply own file name
QRCode.from("Hello World").file("QRCode");

// supply charset hint to ZXING
QRCode.from("Hello World").withCharset("UTF-8");

License:

http://www.apache.org/licenses/LICENSE-2.0.html

About

a simple QRCode generation api for java built on top ZXING

Resources

Stars

Watchers

Forks

Packages

No packages published