Skip to main content

CodeMSIOptions Class

Contains options specific to MSI symbology.

Declaration

public class CodeMSIOptions extends BarcodeOptions

Remarks

Refer to the following help topic for additional information: MSI/Plessey.

The following code snippet creates an MSI Plessey 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 {

        CodeMSIOptions options = CodeMSIOptionsBuilder.create()
            .withPadding(new Padding(10))
            .withShowText(true)
            .withWidth(600)
            .withHeight(200)
            .build();

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

        try (FileOutputStream fileStream = new FileOutputStream(
                outputDir.resolve("msi.png").toFile());
                BarcodeGenerator barcodeGenerator = new BarcodeGenerator(options)) {
                    barcodeGenerator.export(
                            "909123456789",
                            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
CodeMSIOptions

CodeMSIOptions()

Initializes a new instance of the CodeMSIOptions class.

Declaration

public CodeMSIOptions()

Methods

getChecksum() Method

Gets the checksum type for an MSI barcode. The BarcodeGenerator supports only the Mod 10 (Luhn) checksum algorithm.

Declaration

public MSIChecksum getChecksum()

Returns

Type Description
MSIChecksum

The MSI barcode’s checksum type.

setChecksum(MSIChecksum value) Method

Sets the checksum type for MSI barcodes. Only the Mod 10 (Luhn) checksum algorithm is supported.

Declaration

public void setChecksum(MSIChecksum value)

Parameters

Name Type Description
value MSIChecksum

The checksum type for MSI barcodes.