QREncodeMode
Inheritance: java.lang.Object, java.lang.Enum
public enum QREncodeMode extends Enum<QREncodeMode>
Encoding mode for QR barcodes.
Example how to use ECI encoding BarcodeGenerator generator = new BarcodeGenerator(EncodeTypes.QR); generator.setCodeText("12345TEXT"); generator.getParameters().getBarcode().getQR().setQrEncodeMode(QREncodeMode.ECI_ENCODING); generator.getParameters().getBarcode().getQR().setQrECIEncoding(ECIEncodings.UTF8); generator.save("test.png");
Example how to use FNC1 first position in Extended Mode QrExtCodetextBuilder textBuilder = new QrExtCodetextBuilder(); textBuilder.addPlainCodetext("000%89%%0"); textBuilder.addFNC1GroupSeparator(); textBuilder.addPlainCodetext("12345<FNC1>"); //generate barcode BarcodeGenerator generator = new BarcodeGenerator(EncodeTypes.QR); generator.setCodeText(textBuilder.getExtended()); generator.getParameters().getBarcode().getQR().setQrEncodeMode(QREncodeMode.EXTENDED_CODETEXT); generator.getParameters().getBarcode().getCodeTextParameters().setTwoDDisplayText("My Text"); generator.save("d:/test.png"); * This sample shows how to use FNC1 second position in Extended Mode. //create codetext QrExtCodetextBuilder textBuilder = new QrExtCodetextBuilder(); textBuilder.addFNC1SecondPosition("12"); textBuilder.addPlainCodetext("TRUE3456"); //generate barcode BarcodeGenerator generator = new BarcodeGenerator(EncodeTypes.QR); generator.setCodeText(textBuilder.getExtended()); generator.getParameters().getBarcode().getCodeTextParameters().setTwoDDisplayText("My Text"); generator.save("d:/test.png"); This sample shows how to use multi ECI mode in Extended Mode. //create codetext QrExtCodetextBuilder textBuilder = new QrExtCodetextBuilder(); textBuilder.addECICodetext(ECIEncodings.Win1251, "Will"); textBuilder.addECICodetext(ECIEncodings.UTF8, "Right"); textBuilder.addECICodetext(ECIEncodings.UTF16BE, "Power"); textBuilder.addPlainCodetext("t\e\\st"); //generate barcode BarcodeGenerator generator = new BarcodeGenerator(EncodeTypes.QR); generator.setCodeText(textBuilder.getExtended()); generator.getParameters().getBarcode().getQR().setQrEncodeMode(QREncodeMode.EXTENDED_CODETEXT); generator.getParameters().getBarcode().getCodeTextParameters().setTwoDDisplayText("My Text"); generator.save("d:/test.png");
Fields
Field | Description |
---|---|
AUTO | In Auto mode, the CodeText is encoded with maximum data compactness. |
BINARY | In Binary mode, the CodeText is encoded with maximum data compactness. |
BYTES | Encode codetext as plain bytes. |
ECI | In ECI mode, the entire message is re-encoded in the ECIEncoding specified encoding with the insertion of an ECI identifier. |
ECI_ENCODING | Encode codetext with value set in the ECIEncoding property. |
EXTENDED | 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 “ |
EXTENDED_CODETEXT | 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 “ |
UTF_16_BEBOM | Encode codetext with UTF8 encoding with first ByteOfMark character. |
UTF_8_BOM | Encode codetext with UTF8 encoding with first ByteOfMark character. |
Methods
AUTO
public static final QREncodeMode AUTO
In Auto mode, the CodeText is encoded with maximum data compactness. Unicode characters are encoded in kanji mode if possible, or they 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.
BINARY
public static final QREncodeMode 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 QREncodeMode BYTES
Encode codetext as plain bytes. If it detects any Unicode character, the character will be encoded as two bytes, lower byte first.
ECI
public static final QREncodeMode 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. This mode is not supported by MicroQR barcodes.
ECI_ENCODING
public static final QREncodeMode ECI_ENCODING
Encode codetext with value set in the ECIEncoding property. It can be problems with some old (pre 2006) barcode scanners. This mode is not supported by MicroQR barcodes.
EXTENDED
public static final QREncodeMode EXTENDED
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 “
EXTENDED_CODETEXT
public static final QREncodeMode EXTENDED_CODETEXT
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 “
UTF_16_BEBOM
public static final QREncodeMode UTF_16_BEBOM
Encode codetext with UTF8 encoding with first ByteOfMark character. It can be problems with some barcode scanners.
UTF_8_BOM
public static final QREncodeMode UTF_8_BOM
Encode codetext with UTF8 encoding with first ByteOfMark character.
valueOf(Class arg0, String arg1)
public static T <T>valueOf(Class<T> arg0, String arg1)
Parameters:
Parameter | Type | Description |
---|---|---|
arg0 | java.lang.Class | |
arg1 | java.lang.String |
Returns: T
compareTo(E arg0)
public final int compareTo(E arg0)
Parameters:
Parameter | Type | Description |
---|---|---|
arg0 | E |
Returns: int
equals(Object arg0)
public final boolean equals(Object arg0)
Parameters:
Parameter | Type | Description |
---|---|---|
arg0 | java.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 QREncodeMode valueOf(String name)
Parameters:
Parameter | Type | Description |
---|---|---|
name | java.lang.String |
Returns: QREncodeMode
values()
public static QREncodeMode[] values()
Returns: com.aspose.barcode.generation.QREncodeMode[]
wait()
public final void wait()
wait(long arg0)
public final native void wait(long arg0)
Parameters:
Parameter | Type | Description |
---|---|---|
arg0 | long |
wait(long arg0, int arg1)
public final void wait(long arg0, int arg1)
Parameters:
Parameter | Type | Description |
---|---|---|
arg0 | long | |
arg1 | int |