Skip to main content

PDF417OptionsBuilder Class

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

Declaration

public class PDF417OptionsBuilder extends BarcodeOptionsBuilder<PDF417Options,PDF417OptionsBuilder>

Remarks

Refer to the following help topic for additional information: PDF417.

The following code snippet creates a PDF417 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 {

        PDF417Options options = PDF417OptionsBuilder.create()
            .withColumns(3)
            .withTruncateSymbol(false)
            .withErrorCorrectionLevel(PDF417ErrorCorrectionLevel.LEVEL_2)
            .withCompactionMode(PDF417CompactionMode.TEXT)
            .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("pdf417 .png").toFile());
                BarcodeGenerator barcodeGenerator = new BarcodeGenerator(options)) {
                    barcodeGenerator.export(
                            "PDF417 DEMO 1234567890",
                            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

PDF417OptionsBuilder()

Initializes a new instance of the PDF417OptionsBuilder class.

Declaration

public PDF417OptionsBuilder()

Methods

create() Method

Creates a new PDF417OptionsBuilder instance.

Declaration

public static PDF417OptionsBuilder create()

Returns

Type Description
PDF417OptionsBuilder

The current PDF417OptionsBuilder instance for method chaining.

withColumns(int columns) Method

Specifies number of columns in the symbol’s data region. Returns the builder instance for method chaining.

Declaration

public PDF417OptionsBuilder withColumns(int columns)

Parameters

Name Type Description
columns int

The number of columns.

Returns

Type Description
PDF417OptionsBuilder

The builder instance for method chaining.

withCompactionMode(PDF417CompactionMode mode) Method

Specifies the compaction mode. Returns the builder object for method chaining.

Declaration

public PDF417OptionsBuilder withCompactionMode(PDF417CompactionMode mode)

Parameters

Name Type Description
mode PDF417CompactionMode

Indicates the compaction mode.

Returns

Type Description
PDF417OptionsBuilder

The builder object for method chaining.

withErrorCorrectionLevel(PDF417ErrorCorrectionLevel correctionLevel) Method

Specifies the error correction level. Returns the builder object for method chaining.

Declaration

public PDF417OptionsBuilder withErrorCorrectionLevel(PDF417ErrorCorrectionLevel correctionLevel)

Parameters

Name Type Description
correctionLevel PDF417ErrorCorrectionLevel

Indicates the error correction level.

Returns

Type Description
PDF417OptionsBuilder

The builder object for method chaining.

withRows(int rows) Method

Specifies number of rows in the symbol’s data region. Returns the builder instance for method chaining.

Declaration

public PDF417OptionsBuilder withRows(int rows)

Parameters

Name Type Description
rows int

The number of rows.

Returns

Type Description
PDF417OptionsBuilder

The current PDF417OptionsBuilder instance for method chaining.

withTruncateSymbol(boolean truncate) Method

Specifies whether the right-hand side of the code symbol is truncated to create a compact code. Returns the builder instance for method chaining.

Declaration

public PDF417OptionsBuilder withTruncateSymbol(boolean truncate)

Parameters

Name Type Description
truncate boolean

true to create a compact barcode; otherwise, false.

Returns

Type Description
PDF417OptionsBuilder

The current PDF417OptionsBuilder instance for method chaining.

withYToXRatio(int ratio) Method

Specifies the Y (the height of each row) to X (width of the narrowest bar) ratio of the symbol. Returns the builder instance for method chaining.

Declaration

public PDF417OptionsBuilder withYToXRatio(int ratio)

Parameters

Name Type Description
ratio int

The Y to X ratio value.

Returns

Type Description
PDF417OptionsBuilder

The current PDF417OptionsBuilder instance for method chaining.