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
Inheritance
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 |
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 |
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 |
|
Returns
| Type | Description |
|---|---|
PDF417OptionsBuilder |
The current |
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 |