Enum Class DataMatrixEncodeMode

java.lang.Object
java.lang.Enum<DataMatrixEncodeMode>
com.aspose.barcode.generation.DataMatrixEncodeMode
All Implemented Interfaces:
Serializable, Comparable<DataMatrixEncodeMode>, Constable

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 = "犬Right狗";
 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().setEncodeMode(EncodeMode.BINARY);
 generator.save("test.bmp");
 //Extended codetext mode
 //create codetext
 DataMatrixExtCodetextBuilder codetextBuilder=new DataMatrixExtCodetextBuilder();
 codetextBuilder.addECICodetextWithEncodeMode(ECIEncodings.Win1251,EncodeMode.BYTES,"World");
 codetextBuilder.addPlainCodetext("Will");
 codetextBuilder.addECICodetext(ECIEncodings.UTF8,"犬Right狗");
 codetextBuilder.addCodetextWithEncodeMode(EncodeMode.C40,"ABCDE");
 //generate codetext
 String codetext=codetextBuilder.getExtended();
 //generate
 BarcodeGenerator generator=new BarcodeGenerator(EncodeTypes.DATA_MATRIX,codetext);
 generator.getParameters().getBarcode().getDataMatrix().setEncodeMode(EncodeMode.EXTENDED_CODETEXT);
 generator.save("test.bmp");
 

  • Nested Class Summary

    Nested classes/interfaces inherited from class java.lang.Enum

    Enum.EnumDesc<E extends Enum<E>>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    Uses ANSI X12 encoding.
    Encodes one alphanumeric or two numeric characters per byte
    In Auto mode, the CodeText is encoded with maximum data compactness.
    Encode 8 bit values
    In Binary mode, the CodeText is encoded with maximum data compactness.
    Deprecated.
    This property is obsolete and will be removed in future releases.
    Uses C40 encoding.
    In ECI mode, the entire message is re-encoded in the ECIEncoding specified encoding with the insertion of an ECI identifier.
    Uses EDIFACT encoding.
    ExtendedCodetext mode allows to manually switch encodation schemes and ECI encodings in codetext.
    Deprecated.
    This property is obsolete and will be removed in future releases.
    Uses Text encoding.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
     
    Returns the enum constant of this class with the specified name.
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • 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.
    • ASCII

      public static final DataMatrixEncodeMode ASCII

      Encodes one alphanumeric or two numeric characters per byte

    • BYTES

      @Deprecated public static final DataMatrixEncodeMode BYTES
      Deprecated.
      This property is obsolete and will be removed in future releases. Instead, use Base256 option.
      Encode 8 bit values
    • C40

      public static final DataMatrixEncodeMode C40

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

    • TEXT

      public static final DataMatrixEncodeMode TEXT

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

    • 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.

    • ANSIX12

      public static final DataMatrixEncodeMode ANSIX12

      Uses ANSI X12 encoding.

    • EXTENDED_CODETEXT

      @Deprecated public static final DataMatrixEncodeMode EXTENDED_CODETEXT
      Deprecated.
      This property is obsolete and will be removed in future releases. Instead, use the 'Extended' encode mode

      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

      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.
    • 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.
    • 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.
  • Method Details

    • values

      public static DataMatrixEncodeMode[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static DataMatrixEncodeMode valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getValue

      public int getValue()