![]() |
No. 1 Bar Code SDK Provider for Java/.NET Professionals
|
Category | Properties | Value | Comments | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Basic | Property: data
URL: DATA |
Type: String
Default: "" |
Barcode value to encode
GS1-128/EAN-128 Valid Data Char Set:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Property: addCheckSum
URL: ADD-CHECK-SUM |
Type: boolean
Default: false |
addCheckSum property is not applied here. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GS1 128 EAN 128 Special |
Property: processTilde
URL: PROCESS-TILDE |
Type: boolean
Default: false |
Set the processTilde property to true, if you want use the tilde character "~"
to specify special characters in the input data.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Barcode Size Related |
Property: uom
URL: UOM |
Type: int
Default: 0 (pixel) |
Unit of meature for all size related settings in the library.
Valid values: 0: pixel; 1: inch; 2: cm. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Property: X
URL: X |
Type: float
Default: 1 |
Width of barcode bar module (narrow bar), default is 1 pixel | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Property: Y
URL: Y |
Type: float
Default: 30 |
Height of barcode bar module, default is 30 pixel | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Property: barcodeWidth
URL: BARCODE-WIDTH |
Type: float
Default: 0 |
Barcode image width.
If barcodeWidth setting is smaller than the barcode required minimum width, the library will automatically reset to barcode minimum width. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Property: barcodeHeight
URL: BARCODE-HEIGHT |
Type: float
Default: 0 |
Barcode image height.
If barcodeHeight setting is smaller than the barcode required minimum height, the library will automatically reset to barcode minimum height. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Property: leftMargin
URL: LEFT-MARGIN |
Type: float
Default: 0 |
Barcode image left margin size. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Property: rightMargin
URL: RIGHT-MARGIN |
Type: float
Default: 0 |
Barcode image right margin size. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Property: topMargin
URL: TOP-MARGIN |
Type: float
Default: 0 |
Barcode image top margin size. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Property: bottomMargin
URL: BOTTOM-MARGIN |
Type: float
Default: 0 |
Barcode image bottom margin size. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Property: resolution
URL: RESOLUTION |
Type: int
Default: 72 |
Barcode image resolution in DPI (Dots per inch). | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Property: rotate
URL: ROTATE |
Type: int
Default: 0 (IBarcode.ROTATE_0) |
Valid values:
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Font Style |
Property: showText
URL: SHOW-TEXT |
Type: boolean
Default: true |
If true, display barcode data text under the barcode, otherwise do not display. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Property: textFont
URL: TEXT-FONT |
Type: Font
Default: new Font("Arial", Font.PLAIN, 11) |
Barcode text font style.
In Java Servlet web streaming, using the url paramter in the following format: &TEXT-FONT=Arial|bold|9 |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Property: textMargin
URL: TEXT-MARGIN |
Type: float
Default: 6 |
Space between barcode and barcode data text, default is 6 pixel | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Methods |
// 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 |
Generating barcode GS1 128 / EAN 128 in Java Class example
EAN128 barcode = new EAN128(); /* GS1-128 / EAN-128 Valid data char set: all 128 ASCII characters (Char from 0 to 127) to encode Application Identifier (AI), add "()" around the AI code, and followed by the AI data */ barcode.setData("(00)350123451234567894(21)01234567"); // Set the processTilde property to true, if you want use the tilde character "~" // to specify special characters in the input data. Default is false. // // 1) 1-byte character: ~0dd/~1dd/~2dd (character value from 000 ~ 255); ASCII character '~' is presented by ~126 // Strings from "~256" to "~299" are unused // modified to FS, GS, RS and US respectively. // 2) 2-byte character (Unicode): ~6ddddd (character value from 00000 ~ 65535) // Strings from "~665536" to "~699999" are unused // 3) for GS1 AI Code: // ~ai2: AI with 2 digits // ~ai3: AI with 3 digits // ~ai4: AI with 4 digits // ~ai5: AI with 5 digits // ~ai6: AI with 6 digits // ~ai7: AI with 7 digits barcode.setProcessTilde(true); // Unit of Measure, pixel, cm, or inch barcode.setUom(IBarcode.UOM_PIXEL); // barcode bar module width (X) in pixel barcode.setX(3f); // barcode bar module height (Y) in pixel barcode.setY(75f); // barcode image margins barcode.setLeftMargin(0f); barcode.setRightMargin(0f); barcode.setTopMargin(0f); barcode.setBottomMargin(0f); // barcode image resolution in dpi barcode.setResolution(72); // disply barcode encoding data below the barcode barcode.setShowText(true); // barcode encoding data font style barcode.setTextFont(new Font("Arial", 0, 12)); // space between barcode and barcode encoding data barcode.setTextMargin(6); // barcode displaying angle barcode.setRotate(IBarcode.ROTATE_0); /* to save into gif file, file name end with .gif to save into jpeg file, file name end with .jpg to save into eps file, call method drawBarcode2EPS and file name end with .eps */ barcode.drawBarcode("C:\\ean128.gif");
You can use 2 methods to input GS1 AI elements
Copyright © OnBarcode.com. All rights reserved.