com.aspose.barcode

Class QREncodeMode

  • java.lang.Object
    • com.aspose.ms.System.ValueType<com.aspose.ms.System.Enum>
      • com.aspose.ms.System.Enum
        • com.aspose.barcode.QREncodeMode


  • public final class QREncodeMode
    extends com.aspose.ms.System.Enum

    Encoding mode for QR barcodes. It is recomended to Use Auto with CodeTextEncoding = Encoding.UTF8 for latin symbols or digits and Utf8BOM for unicode symbols.

    • Nested Class Summary

      • Nested classes/interfaces inherited from class com.aspose.ms.System.Enum

        com.aspose.ms.System.Enum.AbstractEnum, com.aspose.ms.System.Enum.FlaggedEnum, com.aspose.ms.System.Enum.ObjectEnum, com.aspose.ms.System.Enum.SimpleEnum
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static int Auto
      Encode codetext as is non-unicode charset.
      static int Bytes
      Encode codetext as plain bytes.
      static int ECIEncoding
      Encode codetext with value set in the ECIEncoding property.
      static int ExtendedCodetext
      static int Utf16BEBOM
      Encode codetext with UTF8 encoding with first ByteOfMark character.
      static int Utf8BOM
      Encode codetext with UTF8 encoding with first ByteOfMark character.
      • Fields inherited from class com.aspose.ms.System.Enum

        EnumSeparatorCharArray
    • Method Summary

      • Methods inherited from class com.aspose.ms.System.Enum

        Clone, CloneTo, format, format, get_Caption, get_Value, getName, getName, getNames, getNames, getUnderlyingType, getUnderlyingType, getValue, getValues, isDefined, isDefined, isDefined, isDefined, parse, parse, parse, parse, register, toObject, toString
    • Field Detail

      • Auto

        public static final int Auto

        Encode codetext as is non-unicode charset. If there is any unicode character, the codetext will be encoded with value which is set in CodeTextEncoding.

        See Also:
        Constant Field Values
      • Bytes

        public static final int Bytes

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

        See Also:
        Constant Field Values
      • Utf8BOM

        public static final int Utf8BOM

        Encode codetext with UTF8 encoding with first ByteOfMark character.

        See Also:
        Constant Field Values
      • Utf16BEBOM

        public static final int Utf16BEBOM

        Encode codetext with UTF8 encoding with first ByteOfMark character. It can be problems with some barcode scaners.

        See Also:
        Constant Field Values
      • ECIEncoding

        public static final int ECIEncoding

        Encode codetext with value set in the ECIEncoding property. It can be problems with some old (pre 2006) barcode scaners.


         Example how to use ECI encoding
         
         BarCodeBuilder builder = new BarCodeBuilder();
         builder.SymbologyType = Symbology.QR;
         builder.QREncodeMode = QREncodeMode.ECIEncoding;
         builder.QREncodeType = QREncodeType.ForceQR;
         builder.ECIEncoding = ECIEncodings.UTF8;
         builder.CodeText = "12345TEXT";
         builder.QRErrorLevel = QRErrorLevel.LevelL;
         Bitmap lBmp = builder.GenerateBarCodeImage();
         

        See Also:
        Constant Field Values
      • ExtendedCodetext

        public static final int ExtendedCodetext

        Extended Channel mode which supports FNC1 first position, FNC1 second position and multi ECI modes.

        It is better to use QrExtCodetextBuilder for extended codetext generation.

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

        Encoding Principles:

        All symbols "\" must be doubled "\\" in the codetext.

        FNC1 in first position is set in codetext as as "<FNC1>"

        FNC1 in second position is set in codetext as as "<FNC1(value)>". The value must be single symbols (a-z, A-Z) or digits from 0 to 99.

        Group Separator for FNC1 modes is set as 0x1D character ''

        If you need to insert "<FNC1>" string into barcode write it as "<\FNC1>"

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

        TO disable current ECI mode and convert to default JIS8 mode zero mode ECI indetifier is set. "\000000"

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


          Example how to use FNC1 first position in Extended Mode
          
          //create codetext
          QrExtCodetextBuilder lTextBuilder = new QrExtCodetextBuilder();
          lTextBuilder.AddFNC1FirstPosition();
          lTextBuilder.AddPlainCodetext("000%89%%0");
          lTextBuilder.AddFNC1GroupSeparator();
          lTextBuilder.AddPlainCodetext("12345<FNC1>");
         

        //generate codetext string lCodetext = lTextBuilder.GetExtendedCodetext();

        //generate BarCodeBuilder builder = new BarCodeBuilder(); builder.SymbologyType = Symbology.QR; builder.QREncodeMode = QREncodeMode.ExtendedCodetext; builder.QRErrorLevel = QRErrorLevel.LevelL; builder.CodeText = lCodetext; builder.Display2DText = "My Text"; Bitmap lBmp = builder.GenerateBarCodeImage();

        Example how to use FNC1 second position in Extended Mode
          //create codetext
          QrExtCodetextBuilder lTextBuilder = new QrExtCodetextBuilder();
         lTextBuilder.AddFNC1SecondPosition("12");
         lTextBuilder.AddPlainCodetext("TRUE3456");
         

        //generate codetext string lCodetext = lTextBuilder.GetExtendedCodetext();

        //generate BarCodeBuilder builder = new BarCodeBuilder(); builder.SymbologyType = Symbology.QR; builder.QREncodeMode = QREncodeMode.ExtendedCodetext; builder.QRErrorLevel = QRErrorLevel.LevelL; builder.CodeText = lCodetext; builder.Display2DText = "My Text"; Bitmap lBmp = builder.GenerateBarCodeImage();

        Example how to use multi ECI mode in Extended Mode
          //create codetext
          QrExtCodetextBuilder lTextBuilder = new QrExtCodetextBuilder();
         lTextBuilder.AddECICodetext(ECIEncodings.Win1251, "Will");
         lTextBuilder.AddECICodetext(ECIEncodings.UTF8, "Right");
         lTextBuilder.AddECICodetext(ECIEncodings.UTF16BE, "Power");
         lTextBuilder.AddPlainCodetext(@"t\e\\st");
         

        //generate codetext string lCodetext = lTextBuilder.GetExtendedCodetext();

        //generate BarCodeBuilder builder = new BarCodeBuilder(); builder.SymbologyType = Symbology.QR; builder.QREncodeMode = QREncodeMode.ExtendedCodetext; builder.QRErrorLevel = QRErrorLevel.LevelL; builder.CodeText = lCodetext; builder.Display2DText = "My Text"; Bitmap lBmp = builder.GenerateBarCodeImage();

        See Also:
        Constant Field Values