Skip to main content

ITF14OptionsBuilder Class

Builds an ITF14Options object. Chain builder methods to configure barcode settings, then call the build() method to create the options object.

Declaration

public class ITF14OptionsBuilder extends BarcodeOptionsBuilder<ITF14Options,ITF14OptionsBuilder>

Remarks

Refer to the following help topic for additional information: ITF-14 (UPC Shipping Container Symbol).

The following code snippet creates a UPC Shipping Container Symbol (ITF-14) 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 {

        ITF14Options options = ITF14OptionsBuilder.create()
            .withCalculateChecksum(true)
            .withWideNarrowRatio(3)
            .withPadding(new Padding(10))
            .withShowText(true)
            .withWidth(600)
            .withHeight(150)
            .build();

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

        try (FileOutputStream fileStream = new FileOutputStream(
                outputDir.resolve("itf14.png").toFile());
                BarcodeGenerator barcodeGenerator = new BarcodeGenerator(options)) {
                    barcodeGenerator.export(
                            "0123456709498765432101234567891",
                            fileStream,
                            DXImageFormat.getPng());
        }
    }
}

Inherited Members

com.devexpress.system.JavaObject.clone()
com.devexpress.system.JavaObject.equals(java.lang.Object)
com.devexpress.system.JavaObject.hashCode()
com.devexpress.system.JavaObject.initFields()
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

ITF14OptionsBuilder()

Initializes a new instance of the ITF14OptionsBuilder class.

Declaration

public ITF14OptionsBuilder()

Methods

create() Method

Creates a new ITF14OptionsBuilder object.

Declaration

public static ITF14OptionsBuilder create()

Returns

Type Description
ITF14OptionsBuilder

The current ITF14OptionsBuilder instance for method chaining.

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 ITF14OptionsBuilder withCalculateChecksum(boolean calculateChecksum)

Parameters

Name Type Description
calculateChecksum boolean

true, to add a check character; otherwise, false.

Returns

Type Description
ITF14OptionsBuilder

The current ITF14OptionsBuilder instance for method chaining.

withWideNarrowRatio(float wideNarrowRatio) Method

Specifies the wide bar to narrow bar ratio and returns the builder instance for method chaining.

Declaration

public ITF14OptionsBuilder withWideNarrowRatio(float wideNarrowRatio)

Parameters

Name Type Description
wideNarrowRatio float

The ratio of wide bars to narrow bars.

Returns

Type Description
ITF14OptionsBuilder

The current ITF14OptionsBuilder instance for method chaining.