Package com.storedobject.common
Class Barcode
java.lang.Object
com.storedobject.common.Barcode
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionBarcode()
Constructor (Size will be 100x100).Barcode
(Barcode.Format format, String data) Constructor (Size will be 100x100).Barcode
(Barcode.Format format, String data, int width, int height) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionstatic Barcode
Create a bar code from an image.getData()
Get data containing in this barcode.final Barcode.Format
Get the barcode format.int
Get the height of hte barcode image.getImage()
Get the image of the barcode.int
getWidth()
Get the width of the barcode image.boolean
Check whether barcode data will be printed at the bottom of the image or not.static String
Read data from a barcode image.void
Set data to the barcode.final void
setFormat
(Barcode.Format format) Set the barcode format.void
setHeight
(int height) Set the height of hte barcode image.void
setPrintText
(boolean printText) Set totrue
for printing barcode data at the bottom of the image.void
setWidth
(int width) Set the width of the barcode image.
-
Constructor Details
-
Barcode
public Barcode()Constructor (Size will be 100x100). -
Barcode
Constructor (Size will be 100x100).- Parameters:
format
- Formatdata
- Barcode data
-
Barcode
Constructor.- Parameters:
format
- Formatdata
- Barcode datawidth
- Image widthheight
- Image height
-
-
Method Details
-
getData
-
setData
-
getFormat
-
setFormat
Set the barcode format.- Parameters:
format
- Format to set
-
getWidth
public int getWidth()Get the width of the barcode image.- Returns:
- Width.
-
setWidth
public void setWidth(int width) Set the width of the barcode image.- Parameters:
width
- Width
-
getHeight
public int getHeight()Get the height of hte barcode image.- Returns:
- Height.
-
setHeight
public void setHeight(int height) Set the height of hte barcode image.- Parameters:
height
- Height.
-
getImage
Get the image of the barcode.- Returns:
- Image of the barcode.
- Throws:
Exception
- If any error occurs.
-
isPrintText
public boolean isPrintText()Check whether barcode data will be printed at the bottom of the image or not.- Returns:
- True or false.
-
setPrintText
public void setPrintText(boolean printText) Set totrue
for printing barcode data at the bottom of the image. (Barcode data will not be printed for the following formats, irrespective of this setting: QR_CODE, DATA_MATRIX, PDF_417 and AZTEC).- Parameters:
printText
- True or false
-
read
-
create
-