com.lowagie.text.pdf
public class BarcodeDatamatrix extends Object
Nested Class Summary | |
---|---|
static class | BarcodeDatamatrix.DmParams |
static class | BarcodeDatamatrix.Placement |
static class | BarcodeDatamatrix.ReedSolomon |
Field Summary | |
---|---|
static BarcodeDatamatrix.DmParams[] | dmSizes |
static int | DM_ASCII
ASCII encodation. |
static int | DM_AUTO
The best encodation will be used. |
static int | DM_B256
Binary encodation. |
static int | DM_C40
C40 encodation. |
static int | DM_EDIFACT
EDIFACT encodation. |
static int | DM_ERROR_EXTENSION
An error while parsing an extension. |
static int | DM_ERROR_INVALID_SQUARE
The dimensions given for the symbol are illegal. |
static int | DM_ERROR_TEXT_TOO_BIG
The text is too big for the symbology capabilities. |
static int | DM_EXTENSION
Allows extensions to be embedded at the start of the text. |
static int | DM_NO_ERROR
No error. |
static int | DM_RAW
No encodation needed. |
static int | DM_TEST
Doesn't generate the image but returns all the other information. |
static int | DM_TEXT
TEXT encodation. |
static int | DM_X21
X21 encodation. |
int | extOut |
int | height |
byte[] | image |
int | options |
short[] | place |
int | width |
int | ws |
static String | x12 |
Constructor Summary | |
---|---|
BarcodeDatamatrix()
Creates an instance of this class. |
Method Summary | |
---|---|
static int | asciiEncodation(byte[] text, int textOffset, int textLength, byte[] data, int dataOffset, int dataLength) |
static int | b256Encodation(byte[] text, int textOffset, int textLength, byte[] data, int dataOffset, int dataLength) |
Image | createAwtImage(Color foreground, Color background)
Creates a java.awt.Image . |
Image | createImage() Gets an Image with the barcode. |
static int | C40OrTextEncodation(byte[] text, int textOffset, int textLength, byte[] data, int dataOffset, int dataLength, boolean c40) |
void | draw(byte[] data, int dataSize, BarcodeDatamatrix.DmParams dm) |
static int | EdifactEncodation(byte[] text, int textOffset, int textLength, byte[] data, int dataOffset, int dataLength) |
int | generate(String text)
Creates a barcode. |
int | generate(byte[] text, int textOffset, int textSize)
Creates a barcode. |
static int | getEncodation(byte[] text, int textOffset, int textSize, byte[] data, int dataOffset, int dataSize, int options, boolean firstMatch) |
int | getHeight()
Gets the height of the barcode. |
byte[] | getImage()
Gets the generated image. |
static int | getNumber(byte[] text, int ptrIn, int n) |
int | getOptions()
Gets the barcode options. |
int | getWidth()
Gets the width of the barcode. |
int | getWs()
Gets the whitespace border around the barcode. |
static boolean | isDigit(int c) |
static void | makePadding(byte[] data, int position, int count) |
int | processExtensions(byte[] text, int textOffset, int textSize, byte[] data) |
void | setBit(int x, int y, int xByte) |
void | setHeight(int height)
Sets the height of the barcode. |
void | setOptions(int options)
Sets the options for the barcode generation. |
void | setWidth(int width)
Sets the width of the barcode. |
void | setWs(int ws)
Sets the whitespace border around the barcode. |
static int | X12Encodation(byte[] text, int textOffset, int textLength, byte[] data, int dataOffset, int dataLength) |
java.awt.Image
. A successful call to the method generate()
before calling this method is required.Parameters: foreground the color of the bars background the color of the background
Returns: the image
Image
with the barcode. A successful call to the method generate()
before calling this method is required.Returns: the barcode Image
Throws: BadElementException on error
String
is interpreted with the ISO-8859-1 encodingParameters: text the text
Returns: the status of the generation. It can be one of this values:
DM_NO_ERROR
- no error.
DM_ERROR_TEXT_TOO_BIG
- the text is too big for the symbology capabilities.
DM_ERROR_INVALID_SQUARE
- the dimensions given for the symbol are illegal.
DM_ERROR_EXTENSION
- an error was while parsing an extension.
Throws: java.io.UnsupportedEncodingException on error
Parameters: text the text textOffset the offset to the start of the text textSize the text size
Returns: the status of the generation. It can be one of this values:
DM_NO_ERROR
- no error.
DM_ERROR_TEXT_TOO_BIG
- the text is too big for the symbology capabilities.
DM_ERROR_INVALID_SQUARE
- the dimensions given for the symbol are illegal.
DM_ERROR_EXTENSION
- an error was while parsing an extension.
generate()
. This height doesn't include the whitespace border, if any.Returns: the height of the barcode
Returns: the generated image
Returns: the barcode options
generate()
. This width doesn't include the whitespace border, if any.Returns: the width of the barcode
Returns: the whitespace border around the barcode
The allowed dimensions are (height, width):
10, 10
12, 12
8, 18
14, 14
8, 32
16, 16
12, 26
18, 18
20, 20
12, 36
22, 22
16, 36
24, 24
26, 26
16, 48
32, 32
36, 36
40, 40
44, 44
48, 48
52, 52
64, 64
72, 72
80, 80
88, 88
96, 96
104, 104
120, 120
132, 132
144, 144
Parameters: height the height of the barcode
One of:
DM_AUTO
- the best encodation will be used
DM_ASCII
- ASCII encodation
DM_C40
- C40 encodation
DM_TEXT
- TEXT encodation
DM_B256
- binary encodation
DM_X21
- X21 encodation
DM_EDIFACT
- EDIFACT encodation
DM_RAW
- no encodation. The bytes provided are already encoded and will be added directly to the barcode, using padding if needed. It assumes that the encodation state is left at ASCII after the last byte.
One of:
DM_EXTENSION
- allows extensions to be embedded at the start of the text:
exxxxxx - ECI number xxxxxx
m5 - macro 5
m6 - macro 6
f - FNC1
saabbccccc - Structured Append, aa symbol position (1-16), bb total number of symbols (2-16), ccccc file identification (0-64515)
p - Reader programming
. - extension terminator
Example for a structured append, symbol 2 of 6, with FNC1 and ECI 000005. The actual text is "Hello".
s020600075fe000005.Hello
One of:
DM_TEST
- doesn't generate the image but returns all the other information.
Parameters: options the barcode options
The allowed dimensions are (height, width):
10, 10
12, 12
8, 18
14, 14
8, 32
16, 16
12, 26
18, 18
20, 20
12, 36
22, 22
16, 36
24, 24
26, 26
16, 48
32, 32
36, 36
40, 40
44, 44
48, 48
52, 52
64, 64
72, 72
80, 80
88, 88
96, 96
104, 104
120, 120
132, 132
144, 144
Parameters: width the width of the barcode
Parameters: ws the whitespace border around the barcode