DataMatrixCompactionMode Enum
Lists compaction modes used in DataMatrix barcode symbology.
Declaration
public enum DataMatrixCompactionMode extends Enum<DataMatrixCompactionMode> implements IIntEnum
Members
| Name | Description |
|---|---|
ASCII
|
Encoding mode used to store double digit numerics, ASCII values 0 - 127, and Extended ASCII values 128 - 255. |
BINARY
|
Encoding mode used to store binary data. They are encoded using 8 bits per symbol. |
C40
|
Encoding mode for upper-case alphanumeric, lower case, and special characters. |
EDIFACT
|
Encoding mode for ASCII values from 32 to 94. |
TEXT
|
Encoding mode for lower-case alphanumeric, upper case, and special characters. |
X12
|
Encoding mode for ANSI X12 EDI data set. |
fromValue(int value)
|
Returns the |
getName()
|
Returns the name of the |
getValue()
|
Returns the integer value associated with the |
toString()
|
Returns the string representation of the |
valueOf(String name)
|
Returns the |
values()
|
Returns an array of all |
Remarks
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());
}
}
}
Refer to the following help topic for additional information: GS1 Data Matrix.