Class Code128BarcodeElement
This class can be used to place a Code 128 barcode on a page.
-
Constructor Summary
ConstructorDescriptionCode128BarcodeElement(String value, ElementPlacement placement, float height)
Initializes a new instance of theCode128BarcodeElement
classCode128BarcodeElement(String value, ElementPlacement placement, float height, float xOffset, float yOffset)
Initializes a new instance of theCode128BarcodeElement
class -
Method Summary
Modifier and TypeMethodDescriptionfloat
Gets the height of the barcode.boolean
Gets a boolean indicating whether to process the tilde character.boolean
Gets a boolean representing if the barcode is a UCC / EAN Code 128 barcode.void
setHeight(float value)
Sets the height of the barcode.void
setProcessTilde(boolean value)
Sets a boolean indicating whether to process the tilde character.void
setUccEan128(boolean value)
Sets a boolean representing if the barcode is a UCC / EAN Code 128 barcode.Methods inherited from class com.dynamicpdf.api.elements.TextBarcodeElement
getFont, getFontSize, getResource, getShowText, getTextColor, getTextFont, setFont, setFontSize, setShowText, setTextColor
Methods inherited from class com.dynamicpdf.api.elements.BarcodeElement
getColor, getValue, getXDimension, setColor, setValue, setXDimension
Methods inherited from class com.dynamicpdf.api.elements.Element
getEvenPages, getOddPages, getPlacement, getXOffset, getYOffset, setEvenPages, setOddPages, setPlacement, setXOffset, setYOffset
-
Constructor Details
-
Code128BarcodeElement
public Code128BarcodeElement(String value, ElementPlacement placement, float height, float xOffset, float yOffset)Initializes a new instance of theCode128BarcodeElement
class- Parameters:
value
- The value of the barcode.placement
- The placement of the barcode on the page.height
- The height of the barcode.xOffset
- The X coordinate of the barcode.yOffset
- The Y coordinate of the barcode.Code sets can be specified along with data, in order to do this
ProcessTilde
property needs to be set to true. Example value: "~BHello ~AWORLD 1~C2345", where ~A, ~B and ~C representing code sets A, B and C respectively. However if any inline code set has invalid characters it will be shifted to an appropriate code set.
-
Code128BarcodeElement
Initializes a new instance of theCode128BarcodeElement
class- Parameters:
value
- The value of the barcode.placement
- The placement of the barcode on the page.height
- The height of the barcode.
-
-
Method Details
-
getHeight
public float getHeight()Gets the height of the barcode.- Returns:
- The height of the barcode.
-
setHeight
public void setHeight(float value)Sets the height of the barcode.- Parameters:
value
- The height of the barcode.
-
getUccEan128
public boolean getUccEan128()Gets a boolean representing if the barcode is a UCC / EAN Code 128 barcode.If true an FNC1 code will be the first character in the barcode.
- Returns:
- A boolean representing if the barcode is a UCC / EAN Code 128 barcode.
-
setUccEan128
public void setUccEan128(boolean value)Sets a boolean representing if the barcode is a UCC / EAN Code 128 barcode.If true an FNC1 code will be the first character in the barcode.
- Parameters:
value
- A boolean representing if the barcode is a UCC / EAN Code 128 barcode.
-
getProcessTilde
public boolean getProcessTilde()Gets a boolean indicating whether to process the tilde character.If true checks for fnc1 (~1) character in the barcode Value and checks for the inline code sets if present in the data to process. Example value: "~BHello ~AWORLD 1~C2345", where ~A, ~B and ~C representing code sets A, B and C respectively. However if any inline code set has invalid characters it will be shifted to an appropriate code set. "\" is used as an escape character to add ~.
- Returns:
- A boolean indicating whether to process the tilde character.
-
setProcessTilde
public void setProcessTilde(boolean value)Sets a boolean indicating whether to process the tilde character.If true checks for fnc1 (~1) character in the barcode Value and checks for the inline code sets if present in the data to process. Example value: "~BHello ~AWORLD 1~C2345", where ~A, ~B and ~C representing code sets A, B and C respectively. However if any inline code set has invalid characters it will be shifted to an appropriate code set.
- Parameters:
value
- A boolean indicating whether to process the tilde character.
-