AztecCodeOptionsBuilder Class
Builds an AztecCodeOptions object. Use chained builder methods to configure barcode settings, then call the build() method to create the options object.
Declaration
public class AztecCodeOptionsBuilder extends BarcodeOptionsBuilder<AztecCodeOptions,AztecCodeOptionsBuilder>
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
AztecCodeOptionsBuilder()
Initializes a new instance of the AztecCodeOptionsBuilder class.
Declaration
public AztecCodeOptionsBuilder()
Methods
create() Method
Creates a AztecCodeOptionsBuilder instance.
Declaration
public static AztecCodeOptionsBuilder create()
Returns
| Type | Description |
|---|---|
AztecCodeOptionsBuilder |
Created instance. |
withCompactionMode(AztecCodeCompactionMode mode) Method
Specifies the Aztec Code encoding mode and returns the builder instance for method chaining.
Declaration
public AztecCodeOptionsBuilder withCompactionMode(AztecCodeCompactionMode mode)
Parameters
| Name | Type | Description |
|---|---|---|
| mode | AztecCodeCompactionMode | Encoding mode. |
Returns
| Type | Description |
|---|---|
AztecCodeOptionsBuilder |
The current |
withErrorCorrectionLevel(AztecCodeErrorCorrectionLevel correctionLevel) Method
Specifies the Aztec Code error correction level that compensates for damaged or incorrectly scanned barcodes. Returns the builder instance for method chaining.
Declaration
public AztecCodeOptionsBuilder withErrorCorrectionLevel(AztecCodeErrorCorrectionLevel correctionLevel)
Parameters
| Name | Type | Description |
|---|---|---|
| correctionLevel | AztecCodeErrorCorrectionLevel | Error correction level. |
Returns
| Type | Description |
|---|---|
AztecCodeOptionsBuilder |
The current |
withVersion(AztecCodeVersion version) Method
Specifies the Aztec Code version. Returns the builder instance for method chaining.
Declaration
public AztecCodeOptionsBuilder withVersion(AztecCodeVersion version)
Parameters
| Name | Type | Description |
|---|---|---|
| version | AztecCodeVersion | Aztec Code version. |
Returns
| Type | Description |
|---|---|
AztecCodeOptionsBuilder |
The current |