Java Code 39 Generator
|
Code 39 information: |
![]() |
Code 39 Basic Settings
Properties | Value | Comments | ||
Property | URL | Options | Default | |
data | DATA | (Data to encode in the Codabar) | "" |
Code 128 value to encode Code 128 Character Set: all 128 ASCII characters (Char from 0 to 127) |
addCheckSum | ADD-CHECK-SUM | (Data to encode in the Codabar) | false |
addCheckSum property is not applied here. |
Code 39 Special Settings
Properties | Value | Comments | ||
Property | URL | Options | Default | |
extension |
EXTENSION | boolean |
false | For encoding lower case letters and other 128 ASCII characters,please set extension property to true. |
process Tilde |
PROCESS-TILDE | boolean |
false | Set the processTilde property to true, if you want use the tilde character "~" to specify special characters in the input data, such as non-printable chars in ASCII table. |
l
|
L | foloat |
1.0f | The space between 2 characters in code 39. This a multiple of X module (bar width). |
showStartStopInText |
SHOW-START-STOP-IN-TEXT | boolean |
A | a * will appear in the beginning and the end of barcode text in Code 39 if ture. |
N |
N | float |
2.0f | Wide bar vs narrow bar ratio. Valid values are 2.0 - 3.0 inclusive, default is 2.0.. |
Properties | Value | Comments | ||
Property | URL | Options | Default | |
showText
|
SHOW-TEXT | true or false | true |
Show text underneath the barcode |
textColor
|
TEXT-COLOR | Color |
black | Color of the shown text |
textFont |
TEXT-FONT | Font |
New font("Arial",Font.PLAIN,11) |
In Java Servlet web streaming, using the url paramter in the following format: |
textMargin |
TEXT-MARGIN | float |
6 | The space between the text and the barcode symbol |
Code 39 Size Settings
Properties | Value | Comments | ||
Property | URL | Options | Default | |
rotate |
Rotate | Degree0, 90, 180, 270 |
0 (Barcode.Rotate_0) |
1 (IBarcode.ROTATE_90) 2 (IBarcode.ROTATE_180) 3 (IBarcode.ROTATE_270) |
autoResize |
AUTO-RESIZE | true or false |
false | Auto resize the generated barcode image |
barcodeHeight | BARCODE-HEIGHT | float |
0 | Barcode image Height |
barcodeWidth | BARCODE-WIDTH | float |
0 | Barcode image Width |
bottomMargin |
BOTTOM-MARGIN | float | 0 | Barcode image bottom margin size |
leftMargin | LEFT-MARGINE | float | 0 | Barcode image left margin size |
rightMargin | RIGHT-MARGIN | float | 0 | Barcode image right margin size. |
topMargin | TOP-MARGIN | float | 0 | Barcode image Top margin size |
barAlignment | BARALIGMENT | int | 1(center) | Barcode horizontal alignment inside the image. 0: left, 1: center, 2: right. |
uom | UOM | Pixel, Cm, or Inch | 0(Pixel) | Unit of Measure for all numeric properties.Valid values: 0: pixel; 1: inch; 2: cm. |
X | X | float | 1 | Width of barcode bar module (narrow bar), default is 1 pixel |
Y | Y | float | 30 | Height of barcode bar module, default is 30 pixel |
Code 39 Color Settings
Properties | Value | Comments | ||
Property | URL | Options | Default | |
backColor |
BACK -COLOR | Color | white |
Barcode image background color |
foreColor |
FORE -COLOR |
Color |
black | Barcode image foreground color |
Code 39 Image Settings
Properties | Value | Comments | ||
Property | URL | Options | Default | |
resolution |
RESOLUTION | int | 72 | Resolution of Codabar Image, Dots Per Inch |
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 Exceptionpublic 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