EAN128Options Class
Contains options specific to EAN128 symbology.
Declaration
public class EAN128Options extends BarcodeOptions
Remarks
Refer to the following help topic for additional information: EAN-128 (GS1-128 / UCC-128).
The following code snippet creates an EAN-128 (UCC) 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 {
EAN128Options options = EAN128OptionsBuilder.create()
.withPadding(new Padding(10))
.withShowText(true)
.withWidth(600)
.build();
Path outputDir = Path.of("output");
Files.createDirectories(outputDir);
try (FileOutputStream fileStream = new FileOutputStream(
outputDir.resolve("ean128.png").toFile());
BarcodeGenerator barcodeGenerator = new BarcodeGenerator(options)) {
barcodeGenerator.export(
"(01)09506000134352(17)260630(10)ABC123",
fileStream,
DXImageFormat.getPng());
}
}
}
Inherited Members
Inheritance
EAN128Options()
Initializes a new instance of the EAN128Options class.
Declaration
public EAN128Options()
Methods
getCharset() Method
Gets the character set used for encoding.
Declaration
public Code128CharacterSet getCharset()
Returns
| Type | Description |
|---|---|
| Code128CharacterSet | The character set. |
Remarks
The getCharset() method returns the current symbol set allowed in barcode text. Use setCharset(Code128CharacterSet) to change this symbol set. If barcode data contains unsupported characters, the Barcode Generation API throws an exception.
getFNC1Substitute() Method
Gets the character that is used as a substitute for the FNC1 separator in EAN-128 input data.
Declaration
public String getFNC1Substitute()
Returns
| Type | Description |
|---|---|
| String | The character to be replaced. |
Remarks
The getFNC1Substitute() method returns the placeholder string that generates the FNC1 character. Human-readable EAN-128 text does not include this placeholder string.
getHumanReadableText() Method
Gets whether the human-readable text is displayed for the EAN128 barcode.
Declaration
public boolean getHumanReadableText()
Returns
| Type | Description |
|---|---|
| boolean |
|
setCharset(Code128CharacterSet value) Method
Specifies the character set used for encoding (A, B, or C).
Declaration
public void setCharset(Code128CharacterSet value)
Parameters
| Name | Type | Description |
|---|---|---|
| value | Code128CharacterSet | The character set. |
setFNC1Substitute(String value) Method
Specifies the substitute character used to represent the FNC1 separator in input data.
Declaration
public void setFNC1Substitute(String value)
Parameters
| Name | Type | Description |
|---|---|---|
| value | String | The substitute character. |
Remarks
Use the setFNC1Substitute(String) method to specify the placeholder string that generates the FNC1 character. Human-readable EAN-128 text does not include this placeholder string.
setHumanReadableText(boolean value) Method
Specifies whether to display the human-readable text below the barcode.
Declaration
public void setHumanReadableText(boolean value)
Parameters
| Name | Type | Description |
|---|---|---|
| value | boolean |
|