Enum Class DotCodeEncodeMode

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

public enum DotCodeEncodeMode extends Enum<DotCodeEncodeMode>

Encoding mode for DotCode barcodes.


 
 //Auto mode with macros
 String codetext = ""[)>05CodetextWithMacros05"";
 BarcodeGenerator generator = new BarcodeGenerator(EncodeTypes.DOT_CODE, codetext);
 {
     generator.save("test.bmp");
 }

 //Auto mode
 String codetext = "犬Right狗";
 BarcodeGenerator generator = new BarcodeGenerator(EncodeTypes.DOT_CODE, codetext);
 {
     generator.getParameters().getBarcode().getDotCode().setECIEncoding(ECIEncodings.UTF8);
     generator.save("test.bmp");
 }

 //Bytes mode
 byte[] encodedArr = { 0xFF, 0xFE, 0xFD, 0xFC, 0xFB, 0xFA, 0xF9 };
 BarcodeGenerator generator = new BarcodeGenerator(EncodeTypes.DOT_CODE);
 {
     generator.setCodetext(encodedArr);
     generator.getParameters().getBarcode().getDotCode().setDotCodeEncodeMode(DotCodeEncodeMode.BINARY);
     generator.save("test.bmp");
 }
 //Extended codetext mode
 //create codetext
 DotCodeExtCodetextBuilder textBuilder = new DotCodeExtCodetextBuilder();
 textBuilder.addFNC1FormatIdentifier();
 textBuilder.addECICodetext(ECIEncodings.Win1251, "Will");
 textBuilder.addFNC1FormatIdentifier();
 textBuilder.addECICodetext(ECIEncodings.UTF8, "犬Right狗");
 textBuilder.addFNC3SymbolSeparator();
 textBuilder.addFNC1FormatIdentifier();
 textBuilder.addECICodetext(ECIEncodings.UTF16BE, "犬Power狗");
 textBuilder.addPlainCodetext("Plain text");
 //generate codetext
 String codetext = textBuilder.getExtended();
 //generate
 BarcodeGenerator generator = new BarcodeGenerator(EncodeTypes.DOT_CODE, codetext);
 {
     generator.getParameters().getBarcode().getDotCode().setDotCodeEncodeMode(DotCodeEncodeMode.EXTENDED_CODETEXT);
           generator.save("test.bmp");
 }
 

  • Enum Constant Details

    • AUTO

      public static final DotCodeEncodeMode 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.

    • BYTES

      @Deprecated public static final DotCodeEncodeMode BYTES
      Deprecated.

      Encode codetext as plain bytes. If it detects any Unicode character, the character will be encoded as two bytes, lower byte first.

    • EXTENDED_CODETEXT

      @Deprecated public static final DotCodeEncodeMode EXTENDED_CODETEXT
      Deprecated.

      Extended mode which supports multi ECI modes.

      It is better to use DotCodeExtCodetextBuilder 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.

    • BINARY

      public static final DotCodeEncodeMode 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 DotCodeEncodeMode 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.

    • EXTENDED

      public static final DotCodeEncodeMode EXTENDED

      Extended mode which supports multi ECI modes.

      It is better to use DotCodeExtCodetextBuilder 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.

  • Method Details

    • values

      public static DotCodeEncodeMode[] 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 DotCodeEncodeMode 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()