Barcode PDF 417
Barbecue is a free and open source Java library for Barcode generation.
This requires the library barbecue-1.5-beta1.jar to be in classpath.
The following example shows generating PDF417 Barcode.
package com.bethecoder.tutorials.barbecue;
import java.io.File;
import net.sourceforge.barbecue.Barcode;
import net.sourceforge.barbecue.BarcodeFactory;
import net.sourceforge.barbecue.BarcodeImageHandler;
public class PDF417BarCodeTest {
public static void main ( String [] args ) throws Exception {
//Get PDF417 Two dimensional Barcode instance from the Factory
Barcode barcode = BarcodeFactory.createPDF417 ( "be the coder" ) ;
File imgFile = new File ( "testpdf417.png" ) ;
//Write the bar code to PNG file
BarcodeImageHandler.savePNG ( barcode, imgFile ) ;
}
}
It gives the following output,