Java Code 128 Generator Image Setting Tutorial
sample source code to generate linear Code 128 in png, jpeg, etc. image formats in Java
- Permanent license with the purchase of the developer license
- Generate barcodes which can be added to Oracle Reports and Crystal Reports
- Class library contains all necessary class files for java barcode generation
- Draw high-quality Code 128 barcodes in Java Class, J2SE applications by setting the size of barcode
- Java Client applications (Java Class, Swing, Applet, Java Bean and J2SE) are supported
- Code 128 image width in Java can be changed with Y (bar height), barcodeHeight, topMargin and bottomMargin
- Unit of Measure can set the generated Code 128 image in Inch, CM or Pixel
- Text margin, text font can influence the size of Code 128 in Java
- Show text can enable or disenable with Java Code 128 generator
- High quality Code 128 images may be printed with any printers, including those low resolution printers
Code 128, also known as ANSI/AIM 128, ANSI/AIM Code 128, USS Code 128, Uniform Symbology Specification Code 128, is a very capable linear barcode of excellent density, high reliability.
Onbarcode Java Linear Barcode Generator supports 21 linear barcode types' generation and print with about 50 properties to be adjusted to meet any possible requirement.
Code 128 Size Setting for Java concentrates on setting Code 128 linear barcode bar height and width, space and margins from all sides;
Code 128 Data Encoding for Java concentrates on setting Code 128 different character sets with defferent data length in Java applications.
Java Code 128 Image Setting Common Properties and Uses
Code128 barcode = new Code128();
Adjust Code 128 Image Positon
Code 128 image position can be set with rotate and bar alignment:
//Code 128 generated in Java with 0, 90, 180, 270 angles b y rotating it, default is 0 (IBarcode.ROTATE_0);
Valid choices are 0 (IBarcode.ROTATE_0); 1 (IBarcode.ROTATE_90); 2 (IBarcode.ROTATE_180);
//Barcode horizontal alignment inside Code 128 can be set among with 0: left, 1: center, 2: right;
default is 1: center.
Java Code 128 Image Resolution, Color and Rotation
//Code 128 resolution is set in DPI which stands for Dot Per Inch.default is 72;
//Java Code 128 image background color, default is white;
//Java Code 128 fore ground color, which actually is the bar color, default is black;
//the color of the text below the image
//rotate the Code 128 image with 0, 90, 180, 270 degrees in Java projects
Hide Code 128 Text
Code 128 generator in Java show text can be enable or disable with your need. If the show text property is set to be false, the text of the Code 128 in Java can be hided without showing
Java Code 128 Image Format Setting
Java Code 128 generation control supports generating high quality Code 128 image with common used image formats like png, tiff, gif, jpeg and bmp. A sample code is below for your easier implementation with just copying and changing to the target format.