Java ISBN generator is a mature and reliable Java barcode generation component for creating ISBN barcodes in Java, Jasper Reports, iReport, and Eclipse BIRT projects. High-quality ISBN barcode images can be drawn and printed into GIF, BMP, PNG, JPEG/JPG & TIFF formats with Java ISBN barcode generator. Rich barcode options are provided to customize ISBN barcode properties in accordance with your needs.
ISBN information:
ISBN: is similar to EAN-13 in encoding scheme and is a 9-digit data length linear barcode type. It is commonly used for labeling books.
Available encoding data:
numeric digits: 0-9
12 digit data length only
The structure of an ISBN:
1. Fixed prefix:978 or 979
2. The company number(number system).
3. The item number( manufacture code).
4. The item reference(product code).
5. Check digit.
|
 |
1. Generate ISBN in Java class with the changing of barcode properties.
// Create Java ISBN object
ISBN barcode = new ISBN();
// Set ISBN data text to encode
barcode.setData("978123456789");
// Generate ISBN barcode & print into Graphics2D object
//barcode.drawBarcode("Java Graphics2D object");
// Generate ISBN barcode & encode into GIF format
barcode.drawBarcode("C://barcode-isbn.gif");
// Generate ISBN barcode & encode into JPEG format
barcode.drawBarcode("C://barcode-isbn.jpg");
2. Generate & encode ISBN to EPS with changing the values concerned.
// Create Java ISBN object
ISBN barcode = new ISBN();
// Set ISBN data text to encode
barcode.setData("978000111222");
// Generate ISBN barcode & encode into EPS
barcode.drawBarcode2EPS("C://barcode-isbn.eps");
3. Generate & encode ISBN in html or jsp pages.
1. Copy barcode folder and its contents from demo package to Apache Tomcat.
2. Start Apache Tomcat, go to http://YourDomain:Port/barcode/barcode?DATA=978123456789&TYPE=isbn
3. Insert an image tag (img) into your page. For example,
<imgsrc="http://YourDomain:Port/barcode/barcode?DATA=978123456789&TYPE=isbn" />
4. Two ways to set the width and height of generated barcode ISBN image.
1. Set the values of the barcodeWidth and barcodeHeight properties.
or
2. Set X (bar module width) and Y (bar module height) values
Method
// generate barcode and output to OutputStream object
public boolean drawBarcode(OutputStream outputStream) throws Exception
// generate barcode into a new BufferedImage object
public BufferedImage drawBarcode() throws Exception
/*
Use this method to generate barcode, and save into gif or jpeg files
1. to save into gif file, filename ends with ".gif", like "c:\\barcode.gif"
2. to save into jpeg file, filename ends with ".jpg", like "c:\\barcode.jpg"
*/
public byte[] drawBarcodeToBytes() throws Exception
public boolean drawBarcode(String imageFile) throws Exception
// Generate barcode and save into EPS file, the filename must ends with ".eps"
public void drawBarcode2EPS(String filename) throws Exception
// Generate barcode on Graphics2D object within certain area
public void drawBarcode(Graphics2D g, Rectangle2D rectangle) throws Exception