java.lang.Object
com.lowagie.text.pdf.Barcode
- Direct Known Subclasses:
Barcode128,Barcode39,BarcodeCodabar,BarcodeEAN,BarcodeEANSUPP,BarcodeInter25,BarcodePostnet
Deprecated.
Base class containing properties and methods common to all barcode types.
- Author:
- Paulo Soares (psoares@consiste.pt)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected StringDeprecated.The alternate text to be used, if present.protected floatDeprecated.The height of the bars.protected floatDeprecated.If positive, the text distance under the bars.protected booleanDeprecated.Shows the generated checksum in the the text.static final intDeprecated.A type of barcodeprotected StringDeprecated.The code to generate.static final intDeprecated.A type of barcodestatic final intDeprecated.A type of barcodestatic final intDeprecated.A type of barcodeprotected intDeprecated.The code type.static final intDeprecated.A type of barcodestatic final intDeprecated.A type of barcodeprotected booleanDeprecated.Generates extended barcode 39.protected BaseFontDeprecated.The text font.protected booleanDeprecated.The optional checksum generation.protected booleanDeprecated.Show the guard bars for barcode EAN.protected floatDeprecated.The ink spreading.protected floatDeprecated.The bar multiplier for wide bars or the distance between bars for Postnet and Planet.static final intDeprecated.A type of barcodestatic final intDeprecated.A type of barcodeprotected floatDeprecated.The size of the text or the height of the shorter bar in Postnet.protected booleanDeprecated.Show the start and stop character '*' in the text for the barcode 39 or 'ABCD' for codabar.static final intDeprecated.A type of barcodestatic final intDeprecated.A type of barcodeprotected intDeprecated.The text alignment.static final intDeprecated.A type of barcodestatic final intDeprecated.A type of barcodeprotected floatDeprecated.The minimum bar width. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract ImagecreateAwtImage(Color foreground, Color background) Deprecated.Creates ajava.awt.Image.createImageWithBarcode(PdfContentByte cb, Color barColor, Color textColor) Deprecated.Creates anImagewith the barcode.createTemplateWithBarcode(PdfContentByte cb, Color barColor, Color textColor) Deprecated.Creates a template with the barcode.Deprecated.Gets the alternate text.abstract RectangleDeprecated.Gets the maximum area that the barcode and the text, if any, will occupy.floatDeprecated.Gets the height of the bars.floatDeprecated.Gets the text baseline.getCode()Deprecated.Gets the code to generate.intDeprecated.Gets the code type.getFont()Deprecated.Gets the text font.floatDeprecated.Gets the amount of ink spreading.floatgetN()Deprecated.Gets the bar multiplier for wide bars.floatgetSize()Deprecated.Gets the size of the text.intDeprecated.Gets the text alignment.floatgetX()Deprecated.Gets the minimum bar width.booleanDeprecated.Gets the property to show the generated checksum in the the text.booleanDeprecated.Gets the property to generate extended barcode 39.booleanDeprecated.Gets the optional checksum generation.booleanDeprecated.Gets the property to show the guard bars for barcode EAN.booleanDeprecated.Sets the property to show the start and stop character '*' in the text for the barcode 39.abstract RectangleplaceBarcode(PdfContentByte cb, Color barColor, Color textColor) Deprecated.Places the barcode in aPdfContentByte.voidsetAltText(String altText) Deprecated.Sets the alternate text.voidsetBarHeight(float barHeight) Deprecated.Sets the height of the bars.voidsetBaseline(float baseline) Deprecated.Sets the text baseline.voidsetChecksumText(boolean checksumText) Deprecated.Sets the property to show the generated checksum in the the text.voidDeprecated.Sets the code to generate.voidsetCodeType(int codeType) Deprecated.Sets the code type.voidsetExtended(boolean extended) Deprecated.Sets the property to generate extended barcode 39.voidDeprecated.Sets the text font.voidsetGenerateChecksum(boolean generateChecksum) Deprecated.Setter for property generateChecksum.voidsetGuardBars(boolean guardBars) Deprecated.Sets the property to show the guard bars for barcode EAN.voidsetInkSpreading(float inkSpreading) Deprecated.Sets the amount of ink spreading.voidsetN(float n) Deprecated.Sets the bar multiplier for wide bars.voidsetSize(float size) Deprecated.Sets the size of the text.voidsetStartStopText(boolean startStopText) Deprecated.Gets the property to show the start and stop character '*' in the text for the barcode 39.voidsetTextAlignment(int textAlignment) Deprecated.Sets the text alignment.voidsetX(float x) Deprecated.Sets the minimum bar width.
-
Field Details
-
EAN13
public static final int EAN13Deprecated.A type of barcode- See Also:
-
EAN8
public static final int EAN8Deprecated.A type of barcode- See Also:
-
UPCA
public static final int UPCADeprecated.A type of barcode- See Also:
-
UPCE
public static final int UPCEDeprecated.A type of barcode- See Also:
-
SUPP2
public static final int SUPP2Deprecated.A type of barcode- See Also:
-
SUPP5
public static final int SUPP5Deprecated.A type of barcode- See Also:
-
POSTNET
public static final int POSTNETDeprecated.A type of barcode- See Also:
-
PLANET
public static final int PLANETDeprecated.A type of barcode- See Also:
-
CODE128
public static final int CODE128Deprecated.A type of barcode- See Also:
-
CODE128_UCC
public static final int CODE128_UCCDeprecated.A type of barcode- See Also:
-
CODE128_RAW
public static final int CODE128_RAWDeprecated.A type of barcode- See Also:
-
CODABAR
public static final int CODABARDeprecated.A type of barcode- See Also:
-
x
protected float xDeprecated.The minimum bar width. -
n
protected float nDeprecated.The bar multiplier for wide bars or the distance between bars for Postnet and Planet. -
font
Deprecated.The text font.nullif no text. -
size
protected float sizeDeprecated.The size of the text or the height of the shorter bar in Postnet. -
baseline
protected float baselineDeprecated.If positive, the text distance under the bars. If zero or negative, the text distance above the bars. -
barHeight
protected float barHeightDeprecated.The height of the bars. -
textAlignment
protected int textAlignmentDeprecated.The text alignment. Can beElement.ALIGN_LEFT,Element.ALIGN_CENTERorElement.ALIGN_RIGHT. -
generateChecksum
protected boolean generateChecksumDeprecated.The optional checksum generation. -
checksumText
protected boolean checksumTextDeprecated.Shows the generated checksum in the the text. -
startStopText
protected boolean startStopTextDeprecated.Show the start and stop character '*' in the text for the barcode 39 or 'ABCD' for codabar. -
extended
protected boolean extendedDeprecated.Generates extended barcode 39. -
code
Deprecated.The code to generate. -
guardBars
protected boolean guardBarsDeprecated.Show the guard bars for barcode EAN. -
codeType
protected int codeTypeDeprecated.The code type. -
inkSpreading
protected float inkSpreadingDeprecated.The ink spreading. -
altText
Deprecated.The alternate text to be used, if present.
-
-
Constructor Details
-
Barcode
public Barcode()Deprecated.
-
-
Method Details
-
getX
public float getX()Deprecated.Gets the minimum bar width.- Returns:
- the minimum bar width
-
setX
public void setX(float x) Deprecated.Sets the minimum bar width.- Parameters:
x- the minimum bar width
-
getN
public float getN()Deprecated.Gets the bar multiplier for wide bars.- Returns:
- the bar multiplier for wide bars
-
setN
public void setN(float n) Deprecated.Sets the bar multiplier for wide bars.- Parameters:
n- the bar multiplier for wide bars
-
getFont
Deprecated.Gets the text font.nullif no text.- Returns:
- the text font.
nullif no text
-
setFont
Deprecated.Sets the text font.- Parameters:
font- the text font. Set tonullto suppress any text
-
getSize
public float getSize()Deprecated.Gets the size of the text.- Returns:
- the size of the text
-
setSize
public void setSize(float size) Deprecated.Sets the size of the text.- Parameters:
size- the size of the text
-
getBaseline
public float getBaseline()Deprecated.Gets the text baseline. If positive, the text distance under the bars. If zero or negative, the text distance above the bars.- Returns:
- the baseline.
-
setBaseline
public void setBaseline(float baseline) Deprecated.Sets the text baseline. If positive, the text distance under the bars. If zero or negative, the text distance above the bars.- Parameters:
baseline- the baseline.
-
getBarHeight
public float getBarHeight()Deprecated.Gets the height of the bars.- Returns:
- the height of the bars
-
setBarHeight
public void setBarHeight(float barHeight) Deprecated.Sets the height of the bars.- Parameters:
barHeight- the height of the bars
-
getTextAlignment
public int getTextAlignment()Deprecated.Gets the text alignment. Can beElement.ALIGN_LEFT,Element.ALIGN_CENTERorElement.ALIGN_RIGHT.- Returns:
- the text alignment
-
setTextAlignment
public void setTextAlignment(int textAlignment) Deprecated.Sets the text alignment. Can beElement.ALIGN_LEFT,Element.ALIGN_CENTERorElement.ALIGN_RIGHT.- Parameters:
textAlignment- the text alignment
-
isGenerateChecksum
public boolean isGenerateChecksum()Deprecated.Gets the optional checksum generation.- Returns:
- the optional checksum generation
-
setGenerateChecksum
public void setGenerateChecksum(boolean generateChecksum) Deprecated.Setter for property generateChecksum.- Parameters:
generateChecksum- New value of property generateChecksum.
-
isChecksumText
public boolean isChecksumText()Deprecated.Gets the property to show the generated checksum in the the text.- Returns:
- value of property checksumText
-
setChecksumText
public void setChecksumText(boolean checksumText) Deprecated.Sets the property to show the generated checksum in the the text.- Parameters:
checksumText- new value of property checksumText
-
isStartStopText
public boolean isStartStopText()Deprecated.Sets the property to show the start and stop character '*' in the text for the barcode 39.- Returns:
- value of property startStopText
-
setStartStopText
public void setStartStopText(boolean startStopText) Deprecated.Gets the property to show the start and stop character '*' in the text for the barcode 39.- Parameters:
startStopText- new value of property startStopText
-
isExtended
public boolean isExtended()Deprecated.Gets the property to generate extended barcode 39.- Returns:
- value of property extended.
-
setExtended
public void setExtended(boolean extended) Deprecated.Sets the property to generate extended barcode 39.- Parameters:
extended- new value of property extended
-
getCode
Deprecated.Gets the code to generate.- Returns:
- the code to generate
-
setCode
Deprecated.Sets the code to generate.- Parameters:
code- the code to generate
-
isGuardBars
public boolean isGuardBars()Deprecated.Gets the property to show the guard bars for barcode EAN.- Returns:
- value of property guardBars
-
setGuardBars
public void setGuardBars(boolean guardBars) Deprecated.Sets the property to show the guard bars for barcode EAN.- Parameters:
guardBars- new value of property guardBars
-
getCodeType
public int getCodeType()Deprecated.Gets the code type.- Returns:
- the code type
-
setCodeType
public void setCodeType(int codeType) Deprecated.Sets the code type.- Parameters:
codeType- the code type
-
getBarcodeSize
Deprecated.Gets the maximum area that the barcode and the text, if any, will occupy. The lower left corner is always (0, 0).- Returns:
- the size the barcode occupies.
-
placeBarcode
Deprecated.Places the barcode in aPdfContentByte. 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:
table of the colors of the bars and text barColortextColorResult
nullnullbars and text painted with current fill color
barColornullbars and text painted with
barColornulltextColorbars painted with current color
text painted withtextColorbarColortextColorbars painted with
barColor
text painted withtextColor- Parameters:
cb- thePdfContentBytewhere the barcode will be placedbarColor- the color of the bars. It can benulltextColor- the color of the text. It can benull- Returns:
- the dimensions the barcode occupies
-
createTemplateWithBarcode
Deprecated.Creates a template with the barcode.- Parameters:
cb- thePdfContentByteto create the template. It serves no other usebarColor- the color of the bars. It can benulltextColor- the color of the text. It can benull- Returns:
- the template
- See Also:
-
createImageWithBarcode
Deprecated.Creates anImagewith the barcode.- Parameters:
cb- thePdfContentByteto create theImage. It serves no other usebarColor- the color of the bars. It can benulltextColor- the color of the text. It can benull- Returns:
- the
Image - See Also:
-
createAwtImage
Deprecated.Creates ajava.awt.Image. This image only contains the bars without any text.- Parameters:
foreground- the color of the barsbackground- the color of the background- Returns:
- the image
-
getInkSpreading
public float getInkSpreading()Deprecated.Gets the amount of ink spreading.- Returns:
- the ink spreading
-
setInkSpreading
public void setInkSpreading(float inkSpreading) Deprecated.Sets the amount of ink spreading. This value will be subtracted to the width of each bar. The actual value will depend on the ink and the printing medium.- Parameters:
inkSpreading- the ink spreading
-
getAltText
Deprecated.Gets the alternate text.- Returns:
- the alternate text
-
setAltText
Deprecated.Sets the alternate text. If present, this text will be used instead of the text derived from the supplied code.- Parameters:
altText- the alternate text
-