public enum QREncodeMode extends java.lang.Enum<QREncodeMode>
Encoding mode for QR barcodes.
Example how to use ECI encodingBarcodeGenerator 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 ModeQrExtCodetextBuilder 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");
Enum Constant and 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
Deprecated.
This property is obsolete and will be removed in future releases. Instead, use the 'SetCodeText' method to convert the message to byte array with specified encoding.
|
ECI
In ECI mode, the entire message is re-encoded in the ECIEncoding specified encoding with the insertion of an ECI identifier.
|
ECI_ENCODING
Deprecated.
This property is obsolete and will be removed in future releases. Instead, use ECI option.
|
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 "<FNC1>"
FNC1 in second position is set in codetext as as "<FNC1(value)>".
|
EXTENDED_CODETEXT
Deprecated.
This property is obsolete and will be removed in future releases. Instead, use the 'Extended' encode mode.
|
UTF_16_BEBOM
Deprecated.
This property is obsolete and will be removed in future releases. Instead, use the 'SetCodeText' method with BigEndianUnicode encoding to add a byte order mark (BOM) and encode the message. After that, the CodeText can be encoded using the 'Auto' mode.
|
UTF_8_BOM
Deprecated.
This property is obsolete and will be removed in future releases. Instead, use the 'SetCodeText' method with UTF8 encoding to add a byte order mark (BOM) and encode the message. After that, the CodeText can be encoded using the 'Auto' mode.
|
Modifier and Type | Method and Description |
---|---|
int |
getValue() |
static QREncodeMode |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static QREncodeMode[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final QREncodeMode AUTO
@Deprecated public static final QREncodeMode BYTES
@Deprecated public static final QREncodeMode UTF_8_BOM
@Deprecated public static final QREncodeMode UTF_16_BEBOM
@Deprecated public static final QREncodeMode ECI_ENCODING
public static final QREncodeMode EXTENDED_CODETEXT
public static final QREncodeMode EXTENDED
public static final QREncodeMode BINARY
public static final QREncodeMode ECI
public static QREncodeMode[] values()
for (QREncodeMode c : QREncodeMode.values()) System.out.println(c);
public static QREncodeMode valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic int getValue()