DataMatrixEncodeMode

Inheritance: java.lang.Object, java.lang.Enum

public enum DataMatrixEncodeMode extends Enum<DataMatrixEncodeMode>

DataMatrix encoder’s encoding mode, default to Auto


This sample shows how to do codetext in Extended Mode.
 
 //Auto mode
 String codetext = "\u72acRight\u72d7";
 BarcodeGenerator generator = new BarcodeGenerator(EncodeTypes.DATA_MATRIX, codetext);
 generator.getParameters().getBarcode().getDataMatrix().setECIEncoding(ECIEncodings.UTF8);
 generator.save("test.bmp");
 //Bytes mode
 byte[] encodedArr = { (byte)0xFF, (byte)0xFE, (byte)0xFD, (byte)0xFC, (byte)0xFB, (byte)0xFA, (byte)0xF9 };
 BarcodeGenerator generator = new BarcodeGenerator(EncodeTypes.DATA_MATRIX);
 generator.setCodetext(encodedArr);
 generator.getParameters().getBarcode().getDataMatrix().setDataMatrixEncodeMode(DataMatrixEncodeMode.BINARY);
 generator.save("test.bmp");
 //Extended codetext mode
 //create codetext
 DataMatrixExtCodetextBuilder codetextBuilder=new DataMatrixExtCodetextBuilder();
 codetextBuilder.addECICodetextWithEncodeMode(ECIEncodings.Win1251,DataMatrixEncodeMode.BYTES,"World");
 codetextBuilder.addPlainCodetext("Will");
 codetextBuilder.addECICodetext(ECIEncodings.UTF8,"\u72acRight\u72d7");
 codetextBuilder.addCodetextWithEncodeMode(DataMatrixEncodeMode.C40,"ABCDE");
 //generate codetext
 String codetext=codetextBuilder.getExtended();
 //generate
 BarcodeGenerator generator=new BarcodeGenerator(EncodeTypes.DATA_MATRIX,codetext);
 generator.getParameters().getBarcode().getDataMatrix().setDataMatrixEncodeMode(DataMatrixEncodeMode.EXTENDED_CODETEXT);
 generator.save("test.bmp");

Fields

FieldDescription
ANSIX12Uses ANSI X12 encoding.
ASCIIEncodes one alphanumeric or two numeric characters per byte
AUTOIn Auto mode, the CodeText is encoded with maximum data compactness.
BASE_256Encode 8 bit values
BINARYIn Binary mode, the CodeText is encoded with maximum data compactness.
BYTESEncode 8 bit values
C40Uses C40 encoding.
ECIIn ECI mode, the entire message is re-encoded in the ECIEncoding specified encoding with the insertion of an ECI identifier.
EDIFACTUses EDIFACT encoding.
EXTENDEDExtendedCodetext mode allows to manually switch encodation schemes and ECI encodings in codetext.
EXTENDED_CODETEXT
TEXTUses Text encoding.

Methods

MethodDescription
valueOf(Class arg0, String arg1)
compareTo(E arg0)
equals(Object arg0)
getClass()
getDeclaringClass()
getValue()
hashCode()
name()
notify()
notifyAll()
ordinal()
toString()
valueOf(String name)
values()
wait()
wait(long arg0)
wait(long arg0, int arg1)

ANSIX12

public static final DataMatrixEncodeMode ANSIX12

Uses ANSI X12 encoding.

ASCII

public static final DataMatrixEncodeMode ASCII

Encodes one alphanumeric or two numeric characters per byte

AUTO

public static final DataMatrixEncodeMode AUTO

In Auto mode, the CodeText is encoded with maximum data compactness. Unicode characters are re-encoded in the ECIEncoding specified encoding with the insertion of an ECI identifier. If a character is found that is not supported by the selected ECI encoding, an exception is thrown.

BASE_256

public static final DataMatrixEncodeMode BASE_256

Encode 8 bit values

BINARY

public static final DataMatrixEncodeMode BINARY

In Binary mode, the CodeText is encoded with maximum data compactness. If a Unicode character is found, an exception is thrown.

BYTES

public static final DataMatrixEncodeMode BYTES

Encode 8 bit values

C40

public static final DataMatrixEncodeMode C40

Uses C40 encoding. Encodes Upper-case alphanumeric, Lower case and special characters

ECI

public static final DataMatrixEncodeMode ECI

In ECI mode, the entire message is re-encoded in the ECIEncoding specified encoding with the insertion of an ECI identifier. If a character is found that is not supported by the selected ECI encoding, an exception is thrown. Please note that some old (pre 2006) scanners may not support this mode.

EDIFACT

public static final DataMatrixEncodeMode EDIFACT

Uses EDIFACT encoding. Uses six bits per character, encodes digits, upper-case letters, and many punctuation marks, but has no support for lower-case letters.

EXTENDED

public static final DataMatrixEncodeMode EXTENDED

ExtendedCodetext mode allows to manually switch encodation schemes and ECI encodings in codetext. It is better to use DataMatrixExtCodetextBuilder for extended codetext generation. Use Display2DText property to set visible text to removing managing characters. ECI identifiers are set as single slash and six digits identifier “\000026” - UTF8 ECI identifier All unicode characters after ECI identifier are automatically encoded into correct character codeset. Encodation schemes are set in the next format : “\Encodation_scheme_name:text\Encodation_scheme_name:text”. Allowed encodation schemes are: EDIFACT, ANSIX12, ASCII, C40, Text, Auto. All backslashes (\) must be doubled in text.

EXTENDED_CODETEXT

public static final DataMatrixEncodeMode EXTENDED_CODETEXT

ExtendedCodetext mode allows to manually switch encodation schemes and ECI encodings in codetext.

It is better to use DataMatrixExtCodetextBuilder for extended codetext generation.

Use Display2DText property to set visible text to removing managing characters.

ECI identifiers are set as single slash and six digits identifier “\000026” - UTF8 ECI identifier

All unicode characters after ECI identifier are automatically encoded into correct character codeset.

Encodation schemes are set in the next format : “\Encodation_scheme_name:text\Encodation_scheme_name:text”.

Allowed encodation schemes are: EDIFACT, ANSIX12, ASCII, C40, Text, Auto.

All backslashes (\) must be doubled in text.

TEXT

public static final DataMatrixEncodeMode TEXT

Uses Text encoding. Encodes Lower-case alphanumeric, Upper case and special characters

valueOf(Class arg0, String arg1)

public static T <T>valueOf(Class<T> arg0, String arg1)

Parameters:

ParameterTypeDescription
arg0java.lang.Class
arg1java.lang.String

Returns: T

compareTo(E arg0)

public final int compareTo(E arg0)

Parameters:

ParameterTypeDescription
arg0E

Returns: int

equals(Object arg0)

public final boolean equals(Object arg0)

Parameters:

ParameterTypeDescription
arg0java.lang.Object

Returns: boolean

getClass()

public final native Class<?> getClass()

Returns: java.lang.Class

getDeclaringClass()

public final Class<E> getDeclaringClass()

Returns: java.lang.Class

getValue()

public int getValue()

Returns: int

hashCode()

public final int hashCode()

Returns: int

name()

public final String name()

Returns: java.lang.String

notify()

public final native void notify()

notifyAll()

public final native void notifyAll()

ordinal()

public final int ordinal()

Returns: int

toString()

public String toString()

Returns: java.lang.String

valueOf(String name)

public static DataMatrixEncodeMode valueOf(String name)

Parameters:

ParameterTypeDescription
namejava.lang.String

Returns: DataMatrixEncodeMode

values()

public static DataMatrixEncodeMode[] values()

Returns: com.aspose.barcode.generation.DataMatrixEncodeMode[]

wait()

public final void wait()

wait(long arg0)

public final native void wait(long arg0)

Parameters:

ParameterTypeDescription
arg0long

wait(long arg0, int arg1)

public final void wait(long arg0, int arg1)

Parameters:

ParameterTypeDescription
arg0long
arg1int