Skip to main content

DataMatrixOptions Class

Contains options specific to Data Matrix symbology.

Declaration

public class DataMatrixOptions extends BarcodeOptions

Remarks

Refer to the following help topic for additional information: Data Matrix (ECC200).

The following code snippet creates a Data Matrix (ECC200) 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 {

        DataMatrixOptions options =  DataMatrixOptionsBuilder.create()
            .withCompactionMode(DataMatrixCompactionMode.C40)
            .withMatrixSize(DataMatrixSize.MATRIX_12X12)
            .withModuleSize(5)
            .withShowText(true)
            .withPadding(new Padding(10))
            .build();        

        Path outputDir = Path.of("output");
        Files.createDirectories(outputDir);

        try (FileOutputStream fileStream = new FileOutputStream(
                outputDir.resolve("datamatrix.png").toFile());
                BarcodeGenerator barcodeGenerator = new BarcodeGenerator(options)) {
                    barcodeGenerator.export(
                            "SN:DX-987654321",
                            fileStream,
                            DXImageFormat.getPng());
        }
    }
}

Inherited Members

com.devexpress.system.JavaObject.equals(java.lang.Object)
com.devexpress.system.JavaObject.hashCode()
com.devexpress.system.JavaObject.memberwiseClone()
com.devexpress.system.JavaObject.toString()
java.lang.Object.finalize()
java.lang.Object.getClass()
java.lang.Object.notify()
java.lang.Object.notifyAll()
java.lang.Object.wait()
java.lang.Object.wait(long)
java.lang.Object.wait(long,int)

Inheritance

Object
JavaObject
BarcodeOptions
DataMatrixOptions

DataMatrixOptions()

Initializes a new instance of the DataMatrixOptions class.

Declaration

public DataMatrixOptions()

Methods

getCompactionMode() Method

Gets the encoding scheme used to encode data in the DataMatrix Code.

Declaration

public DataMatrixCompactionMode getCompactionMode()

Returns

Type Description
DataMatrixCompactionMode

The encoding scheme.

getMatrixSize() Method

Gets the barcode matrix size.

Declaration

public DataMatrixSize getMatrixSize()

Returns

Type Description
DataMatrixSize

The barcode matrix size.

setCompactionMode(DataMatrixCompactionMode value) Method

Sets the encoding scheme used to encode data in the DataMatrix Code.

Declaration

public void setCompactionMode(DataMatrixCompactionMode value)

Parameters

Name Type Description
value DataMatrixCompactionMode

The encoding scheme.

setMatrixSize(DataMatrixSize value) Method

Sets the barcode matrix size.

Declaration

public void setMatrixSize(DataMatrixSize value)

Parameters

Name Type Description
value DataMatrixSize

The barcode matrix size.