Interleaved2of5OptionsBuilder Class
Builds an Interleaved2of5Options object. Chain builder methods to configure barcode settings, then call the build() method to create the options object.
Declaration
public class Interleaved2of5OptionsBuilder extends BarcodeOptionsBuilder<Interleaved2of5Options,Interleaved2of5OptionsBuilder>
Remarks
Refer to the following help topic for additional information: Interleaved 2 of 5 (ITF).
The following code snippet creates an Interleaved 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 {
Interleaved2of5Options options = Interleaved2of5OptionsBuilder.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("interleaved2of5.png").toFile());
BarcodeGenerator barcodeGenerator = new BarcodeGenerator(options)) {
barcodeGenerator.export(
"0123456709498765432101234567891",
fileStream,
DXImageFormat.getPng());
}
}
}
Inherited Members
Inheritance
Interleaved2of5OptionsBuilder()
Initializes a new instance of the Interleaved2of5OptionsBuilder class.
Declaration
public Interleaved2of5OptionsBuilder()
Methods
create() Method
Creates a new Interleaved2of5OptionsBuilder object.
Declaration
public static Interleaved2of5OptionsBuilder create()
Returns
| Type | Description |
|---|---|
Interleaved2of5OptionsBuilder |
The current |
withCalculateChecksum(boolean calculateChecksum) Method
Specifies whether a check character should be calculated and added to the barcode data. Returns the builder instance for method chaining.
Declaration
public Interleaved2of5OptionsBuilder withCalculateChecksum(boolean calculateChecksum)
Parameters
| Name | Type | Description |
|---|---|---|
| calculateChecksum | boolean |
|
Returns
| Type | Description |
|---|---|
Interleaved2of5OptionsBuilder |
The current |
withWideNarrowRatio(float wideNarrowRatio) Method
Specifies the wide bar to narrow bar ratio and returns the builder instance for method chaining.
Declaration
public Interleaved2of5OptionsBuilder withWideNarrowRatio(float wideNarrowRatio)
Parameters
| Name | Type | Description |
|---|---|---|
| wideNarrowRatio | float | The ratio of wide bars to narrow bars. |
Returns
| Type | Description |
|---|---|
Interleaved2of5OptionsBuilder |
The current |