Barcode-Lib4J requires Java 9+
Package de.vwsoft.barcodelib4j.oned
Java Class «ImplCode128B» – Generate Code 128 B Barcode
java.lang.Object
de.vwsoft.barcodelib4j.oned.Barcode
de.vwsoft.barcodelib4j.oned.ImplCode128
de.vwsoft.barcodelib4j.oned.ImplCode128B
- All Implemented Interfaces:
Cloneable
Implementation of Code 128 B. To generate instances, please use one of the
newInstance
static methods in the Barcode
class.
Code 128 B is a subset of Code 128, capable of encoding ASCII characters with values from 32 to 127, covering:
- Upper and lower case letters (A-Z, a-z)
- Digits (0-9)
- Space character
- Punctuation and special characters:
!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~
Code 128 B uses an internal checksum included within the barcode symbol but not displayed in plaintext representation.
-
Field Summary
Fields inherited from class de.vwsoft.barcodelib4j.oned.ImplCode128
FNC1, FNC2, FNC3, FNC4
-
Method Summary
Modifier and TypeMethodDescriptionvoid
setContent
(String content, boolean autoComplete, boolean appendOptionalChecksum) Sets the content to be encoded in the barcode.Methods inherited from class de.vwsoft.barcodelib4j.oned.Barcode
clone, draw, draw, draw, getAddOn, getContent, getFont, getRatio, getText, getTextOffset, isFontSizeAdjusted, isOptionalChecksumVisible, isTextOnTop, isTextVisible, newInstance, newInstance, setAddOn, setCustomText, setFont, setFontSizeAdjusted, setOptionalChecksumVisible, setRatio, setTextOffset, setTextOnTop, setTextVisible, supportsAddOn, supportsCustomText, supportsOptionalChecksum, supportsRatio, supportsTextOnTop
-
Method Details
-
setContent
public void setContent(String content, boolean autoComplete, boolean appendOptionalChecksum) throws BarcodeException Sets the content to be encoded in the barcode.Validates the provided content to ensure that it contains only ASCII characters with values between 32 and 127, and throws a
BarcodeException
if it does not.The provided content can also include Function Codes
FNC1
toFNC4
for specific application needs.- Overrides:
setContent
in classImplCode128
- Parameters:
content
- the content to be encoded in the Code 128 B barcodeautoComplete
- has no function in this method implementationappendOptionalChecksum
- has no function, as Code 128 B uses a fixed internal checksum which is not optional- Throws:
BarcodeException
- if the content is empty, or contains characters outside ASCII range 32-127
-