Skip to main content

DataMatrixGS1Options Class

Contains options specific to GS1 DataMatrix symbology.

Declaration

public class DataMatrixGS1Options extends DataMatrixOptions

Remarks

Refer to the following help topic for additional information: GS1 Data Matrix.

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

        DataMatrixGS1Options options = DataMatrixGS1OptionsBuilder.create()
            .withCompactionMode(DataMatrixCompactionMode.C40)
            .withMatrixSize(DataMatrixSize.MATRIX_12X12)
            .withModuleSize(5)
            .withPadding(new Padding(10))
            .withShowText(true)
            .withWidth(600)
            .build();

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

        try (FileOutputStream fileStream = new FileOutputStream(
                outputDir.resolve("datamatrixGS1.png").toFile());
                BarcodeGenerator barcodeGenerator = new BarcodeGenerator(options)) {
                    barcodeGenerator.export(
                            "(01)09521234543213(10)ABC123(17)280101",
                            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

DataMatrixGS1Options()

Initializes a new instance of the DataMatrixGS1Options class.

Declaration

public DataMatrixGS1Options()

Methods

getFNC1Substitute() Method

Gets the character that is used as a substitute for the GS1 FNC1 separator in Data Matrix GS1 input data.

Declaration

public String getFNC1Substitute()

Returns

Type Description
String

The character to be replaced.

Remarks

Note

The GS1 Data Matrix barcode interprets the FNC1 character as a separator. Place FNC1 at the beginning of the data sequence.

getHumanReadableText() Method

Gets whether GS1 human-readable text is displayed for the Data Matrix barcode.

Declaration

public boolean getHumanReadableText()

Returns

Type Description
boolean

true to display the human-readable text; otherwise, false.

setFNC1Substitute(String value) Method

Sets a substitute character that represents the GS1 FNC1 separator in input data.

Declaration

public void setFNC1Substitute(String value)

Parameters

Name Type Description
value String

The substitute character.

Remarks

Note

The GS1 Data Matrix barcode uses the FNC1 character to indicate GS1-compliant data and to separate Application Identifiers (AIs) when required. In GS1 mode, the FNC1 character is automatically inserted by the encoder and must not be entered as a literal symbol in the input data.

setHumanReadableText(boolean value) Method

Sets whether to display the human-readable GS1 text below the barcode.

Declaration

public void setHumanReadableText(boolean value)

Parameters

Name Type Description
value boolean

true to display the human-readable GS1 text below the barcode; otherwise, false.