AztecCodeOptions Class
Contains options specific to Aztec Code symbology.
Declaration
public class AztecCodeOptions extends BarcodeOptions
Remarks
Refer to the following help topic for additional information: Aztec Code.
The following code snippet creates an Aztec Code barcode and customizes its encoding parameters with the Fluent API:
import com.devexpress.drawing.*;
import com.devexpress.docs.barcode.*;
import com.devexpress.system.drawing.*;
import com.devexpress.docs.Padding;
import java.io.*;
import java.nio.file.*;
public class Main {
public static void main(String[] args) throws Exception {
AztecCodeOptions options = AztecCodeOptionsBuilder.create()
.withCompactionMode(AztecCodeCompactionMode.TEXT)
.withErrorCorrectionLevel(AztecCodeErrorCorrectionLevel.LEVEL_2)
.withVersion(AztecCodeVersion.AUTO_VERSION)
.withModuleSize(5)
.withShowText(false)
.build();
Path outputDir = Path.of("output");
Files.createDirectories(outputDir);
try (FileOutputStream fileStream = new FileOutputStream(
outputDir.resolve("aztec.png").toFile());
BarcodeGenerator barcodeGenerator = new BarcodeGenerator(options)) {
barcodeGenerator.export(
"https://www.devexpress.com/try",
fileStream,
DXImageFormat.getPng());
}
}
}
Inherited Members
Inheritance
AztecCodeOptions()
Initializes a new instance of the AztecCodeOptions class.
Declaration
public AztecCodeOptions()
Methods
getCompactionMode() Method
Gets the mode used by the barcode to encode barcode data.
Declaration
public AztecCodeCompactionMode getCompactionMode()
Returns
| Type | Description |
|---|---|
| AztecCodeCompactionMode | Encoding mode. |
Remarks
All 8-bit characters can be encoded into the Aztec Code. Refer to the following topic to get more information: ISO/IEC 8859-1.
getErrorCorrectionLevel() Method
Gets how much redundancy is built into the barcode to compensate for calculation errors.
Declaration
public AztecCodeErrorCorrectionLevel getErrorCorrectionLevel()
Returns
| Type | Description |
|---|---|
| AztecCodeErrorCorrectionLevel | The error level. |
getVersion() Method
Gets the Aztec Code version.
Declaration
public AztecCodeVersion getVersion()
Returns
| Type | Description |
|---|---|
| AztecCodeVersion | The Aztec Code version. |
setCompactionMode(AztecCodeCompactionMode value) Method
Specifies how the barcode encodes data.
Declaration
public void setCompactionMode(AztecCodeCompactionMode value)
Parameters
| Name | Type | Description |
|---|---|---|
| value | AztecCodeCompactionMode | Encoding mode. |
Remarks
All 8-bit characters can be encoded into the Aztec Code.
Refer to the following topic for additional information: ISO/IEC 8859-1.
setErrorCorrectionLevel(AztecCodeErrorCorrectionLevel value) Method
Specifies the amount of redundancy added to the barcode.
Declaration
public void setErrorCorrectionLevel(AztecCodeErrorCorrectionLevel value)
Parameters
| Name | Type | Description |
|---|---|---|
| value | AztecCodeErrorCorrectionLevel | The error level. Recommended: |
Remarks
Higher error-correction levels improve readability when the barcode is damaged or partially obscured but increase the barcode size.
setVersion(AztecCodeVersion value) Method
Specifies the Aztec Code version and the maximum amount of data that the barcode can store.
Declaration
public void setVersion(AztecCodeVersion value)
Parameters
| Name | Type | Description |
|---|---|---|
| value | AztecCodeVersion | The Aztec Code version. |
Remarks
Use AUTO_VERSION to allow the API to choose the smallest version that fits the encoded data.