Properties
High quality GIF and JPEG images may be easily created with the encoder. Before creating a JPEG file with the Java Package, the following requirements must be met:
Install JDK 1.2 or above or verify that JDK 1.2
or above is installed on the server. The encoder requires Java 2 or JDK
1.2 or above to create the JPEG files used by the servlet.
Special requirements for Linux and UNIX servers:
How to create a JPEG or GIF image file:
This is a very simple example of the Java source code used to create an image file from the Linear Java Barcode Package.
import com.businessrefinery.barcode.linear.*;
import com.businessrefinery.barcode.linear.encoder.*;
class CreateImageExample {
public static void main ( String [] args ) {
Linear linear=new Linear();
linear.code="123456789";
linear.barType=linear.CODE39;
BarcodeEncoder bce = new BarcodeEncoder(bc, "JPEG", "newfile.jpeg");
// To create a GIF instead, use
// BarcodeEncoder bce = new BarcodeEncoder(bc, "GIF", "newfile.gif");
System.exit(0);
}
}
Additional examples are provided in the package download for each symbology.