PDF417Options Class
Contains options specific to PDF417 symbology.
Declaration
public class PDF417Options extends BarcodeOptions
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
PDF417Options()
Initializes a new instance of the PDF417Options class.
Declaration
public PDF417Options()
Methods
getColumns() Method
Returns number of columns in the symbol’s data region.
Declaration
public int getColumns()
Returns
| Type | Description |
|---|---|
| int | The number of columns. |
getCompactionMode() Method
Returns the compaction mode.
Declaration
public PDF417CompactionMode getCompactionMode()
Returns
| Type | Description |
|---|---|
| PDF417CompactionMode | An enumeration value that indicates the compaction mode. |
getErrorCorrectionLevel() Method
Returns the error correction level.
Declaration
public PDF417ErrorCorrectionLevel getErrorCorrectionLevel()
Returns
| Type | Description |
|---|---|
| PDF417ErrorCorrectionLevel | An enumeration value that indicates the error correction level. |
getRows() Method
Returns the number of rows in a PDF417 barcode.
Declaration
public int getRows()
Returns
| Type | Description |
|---|---|
| int | The number of rows. |
getTruncateSymbol() Method
Returns whether the right-hand side of the code symbol is truncated to create a compact code.
Declaration
public boolean getTruncateSymbol()
Returns
| Type | Description |
|---|---|
| boolean |
|
getYToXRatio() Method
Returns the Y (the height of each row) to X (width of the narrowest bar) ratio of the symbol.
Declaration
public float getYToXRatio()
Returns
| Type | Description |
|---|---|
| float | The Y to X ratio value. |
setColumns(int value) Method
Specifies the number of columns in the symbol.
Declaration
public void setColumns(int value)
Parameters
| Name | Type | Description |
|---|---|---|
| value | int | The number of columns. |
setCompactionMode(PDF417CompactionMode value) Method
Specifies how input data is compacted (text, numeric, or byte mode).
Declaration
public void setCompactionMode(PDF417CompactionMode value)
Parameters
| Name | Type | Description |
|---|---|---|
| value | PDF417CompactionMode | The compaction mode. |
setErrorCorrectionLevel(PDF417ErrorCorrectionLevel value) Method
Specifies the error correction level.
Declaration
public void setErrorCorrectionLevel(PDF417ErrorCorrectionLevel value)
Parameters
| Name | Type | Description |
|---|---|---|
| value | PDF417ErrorCorrectionLevel | The error correction level. |
setRows(int value) Method
Specifies the number of rows in the symbol.
Declaration
public void setRows(int value)
Parameters
| Name | Type | Description |
|---|---|---|
| value | int | The number of rows. |
setTruncateSymbol(boolean value) Method
Specifies whether to truncate the right-hand side of the symbol.
Declaration
public void setTruncateSymbol(boolean value)
Parameters
| Name | Type | Description |
|---|---|---|
| value | boolean |
|
setYToXRatio(float value) Method
Specifies the height-to-width ratio of barcode elements for print optimization.
Declaration
public void setYToXRatio(float value)
Parameters
| Name | Type | Description |
|---|---|---|
| value | float | The height-to-width ratio. |