|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.lowagie.text.pdf.Barcode
Base class containing properties and methods common to all barcode types.
| Field Summary | |
static int |
CODABAR
A type of barcode |
static int |
CODE128
A type of barcode |
static int |
CODE128_RAW
A type of barcode |
static int |
CODE128_UCC
A type of barcode |
static int |
EAN13
A type of barcode |
static int |
EAN8
A type of barcode |
static int |
PLANET
A type of barcode |
static int |
POSTNET
A type of barcode |
static int |
SUPP2
A type of barcode |
static int |
SUPP5
A type of barcode |
static int |
UPCA
A type of barcode |
static int |
UPCE
A type of barcode |
| Constructor Summary | |
Barcode()
|
|
| Method Summary | |
abstract Image |
createAwtImage(Color foreground,
Color background)
Creates a java.awt.Image. |
Image |
createImageWithBarcode(PdfContentByte cb,
Color barColor,
Color textColor)
Creates an Image with the barcode. |
PdfTemplate |
createTemplateWithBarcode(PdfContentByte cb,
Color barColor,
Color textColor)
Creates a template with the barcode. |
String |
getAltText()
Gets the alternate text. |
abstract Rectangle |
getBarcodeSize()
Gets the maximum area that the barcode and the text, if any, will occupy. |
float |
getBarHeight()
Gets the height of the bars. |
float |
getBaseline()
Gets the text baseline. |
String |
getCode()
Gets the code to generate. |
int |
getCodeType()
Gets the code type. |
BaseFont |
getFont()
Gets the text font. |
float |
getInkSpreading()
Gets the amount of ink spreading. |
float |
getN()
Gets the bar multiplier for wide bars. |
float |
getSize()
Gets the size of the text. |
int |
getTextAlignment()
Gets the text alignment. |
float |
getX()
Gets the minimum bar width. |
boolean |
isChecksumText()
Gets the property to show the generated checksum in the the text. |
boolean |
isExtended()
Gets the property to generate extended barcode 39. |
boolean |
isGenerateChecksum()
Gets the optional checksum generation. |
boolean |
isGuardBars()
Gets the property to show the guard bars for barcode EAN. |
boolean |
isStartStopText()
Sets the property to show the start and stop character '*' in the text for the barcode 39. |
abstract Rectangle |
placeBarcode(PdfContentByte cb,
Color barColor,
Color textColor)
Places the barcode in a PdfContentByte. |
void |
setAltText(String altText)
Sets the alternate text. |
void |
setBarHeight(float barHeight)
Sets the height of the bars. |
void |
setBaseline(float baseline)
Sets the text baseline. |
void |
setChecksumText(boolean checksumText)
Sets the property to show the generated checksum in the the text. |
void |
setCode(String code)
Sets the code to generate. |
void |
setCodeType(int codeType)
Sets the code type. |
void |
setExtended(boolean extended)
Sets the property to generate extended barcode 39. |
void |
setFont(BaseFont font)
Sets the text font. |
void |
setGenerateChecksum(boolean generateChecksum)
Setter for property generateChecksum. |
void |
setGuardBars(boolean guardBars)
Sets the property to show the guard bars for barcode EAN. |
void |
setInkSpreading(float inkSpreading)
Sets the amount of ink spreading. |
void |
setN(float n)
Sets the bar multiplier for wide bars. |
void |
setSize(float size)
Sets the size of the text. |
void |
setStartStopText(boolean startStopText)
Gets the property to show the start and stop character '*' in the text for the barcode 39. |
void |
setTextAlignment(int textAlignment)
Sets the text alignment. |
void |
setX(float x)
Sets the minimum bar width. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int EAN13
public static final int EAN8
public static final int UPCA
public static final int UPCE
public static final int SUPP2
public static final int SUPP5
public static final int POSTNET
public static final int PLANET
public static final int CODE128
public static final int CODE128_UCC
public static final int CODE128_RAW
public static final int CODABAR
| Constructor Detail |
public Barcode()
| Method Detail |
public float getX()
public void setX(float x)
x - the minimum bar widthpublic float getN()
public void setN(float n)
n - the bar multiplier for wide barspublic BaseFont getFont()
null if no text.
null if no textpublic void setFont(BaseFont font)
font - the text font. Set to null to suppress any textpublic float getSize()
public void setSize(float size)
size - the size of the textpublic float getBaseline()
public void setBaseline(float baseline)
baseline - the baseline.public float getBarHeight()
public void setBarHeight(float barHeight)
barHeight - the height of the barspublic int getTextAlignment()
Element.ALIGN_LEFT,
Element.ALIGN_CENTER or Element.ALIGN_RIGHT.
public void setTextAlignment(int textAlignment)
Element.ALIGN_LEFT,
Element.ALIGN_CENTER or Element.ALIGN_RIGHT.
textAlignment - the text alignmentpublic boolean isGenerateChecksum()
public void setGenerateChecksum(boolean generateChecksum)
generateChecksum - New value of property generateChecksum.public boolean isChecksumText()
public void setChecksumText(boolean checksumText)
checksumText - new value of property checksumTextpublic boolean isStartStopText()
public void setStartStopText(boolean startStopText)
startStopText - new value of property startStopTextpublic boolean isExtended()
public void setExtended(boolean extended)
extended - new value of property extendedpublic String getCode()
public void setCode(String code)
code - the code to generatepublic boolean isGuardBars()
public void setGuardBars(boolean guardBars)
guardBars - new value of property guardBarspublic int getCodeType()
public void setCodeType(int codeType)
codeType - the code typepublic abstract Rectangle getBarcodeSize()
public abstract Rectangle placeBarcode(PdfContentByte cb,
Color barColor,
Color textColor)
PdfContentByte. The
barcode is always placed at coordinates (0, 0). Use the
translation matrix to move it elsewhere.The bars and text are written in the following colors:
|
|
Result |
|---|---|---|
|
|
bars and text painted with current fill color |
|
|
bars and text painted with |
|
|
bars painted with current color |
|
|
bars painted with |
cb - the PdfContentByte where the barcode will be placedbarColor - the color of the bars. It can be nulltextColor - the color of the text. It can be null
public PdfTemplate createTemplateWithBarcode(PdfContentByte cb,
Color barColor,
Color textColor)
cb - the PdfContentByte to create the template. It
serves no other usebarColor - the color of the bars. It can be nulltextColor - the color of the text. It can be null
placeBarcode(PdfContentByte cb, Color barColor, Color textColor)
public Image createImageWithBarcode(PdfContentByte cb,
Color barColor,
Color textColor)
Image with the barcode.
cb - the PdfContentByte to create the Image. It
serves no other usebarColor - the color of the bars. It can be nulltextColor - the color of the text. It can be null
ImageplaceBarcode(PdfContentByte cb, Color barColor, Color textColor)
public abstract Image createAwtImage(Color foreground,
Color background)
java.awt.Image. This image only
contains the bars without any text.
foreground - the color of the barsbackground - the color of the background
public float getInkSpreading()
public void setInkSpreading(float inkSpreading)
inkSpreading - the ink spreadingpublic String getAltText()
public void setAltText(String altText)
altText - the alternate text
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||