Industrial2of5Options Class
Contains options specific to Industrial 2 of 5 symbology.
Declaration
public class Industrial2of5Options extends BarcodeOptions
Remarks
Refer to the following help topic for additional information: Industrial 2 of 5.
The following code snippet creates an Industrial 2 of 5 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 {
Industrial2of5Options options = Industrial2of5OptionsBuilder.create()
.withCalculateChecksum(true)
.withWideNarrowRatio(3)
.withPadding(new Padding(10))
.withShowText(true)
.withWidth(600)
.build();
Path outputDir = Path.of("output");
Files.createDirectories(outputDir);
try (FileOutputStream fileStream = new FileOutputStream(
outputDir.resolve("industrial2of5.png").toFile());
BarcodeGenerator barcodeGenerator = new BarcodeGenerator(options)) {
barcodeGenerator.export(
"12345670",
fileStream,
DXImageFormat.getPng());
}
}
}
Inherited Members
Inheritance
Industrial2of5Options()
Initializes a new instance of the Industrial2of5Options class.
Declaration
public Industrial2of5Options()
Methods
getCalculateChecksum() Method
Gets whether a check character should be calculated and added to the barcode data.
Declaration
public boolean getCalculateChecksum()
Returns
| Type | Description |
|---|---|
| boolean |
|
getWideNarrowRatio() Method
Returns the wide bar to narrow bar ratio.
Declaration
public float getWideNarrowRatio()
Returns
| Type | Description |
|---|---|
| float | The density of barcode bars. |
setCalculateChecksum(boolean value) Method
Specifies whether to calculate and append a checksum digit for error detection.
Declaration
public void setCalculateChecksum(boolean value)
Parameters
| Name | Type | Description |
|---|---|---|
| value | boolean |
|
setWideNarrowRatio(float value) Method
Specifies the ratio between wide and narrow bars in the barcode symbol.
Declaration
public void setWideNarrowRatio(float value)
Parameters
| Name | Type | Description |
|---|---|---|
| value | float | The density of barcode bars. |