|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.aspose.barcode.BarCodeBuilder
Backend barcode image renderer which could render to file, to Graphics and to serverlet HttpServletResponse. Supported BarCode symmbologies:
Codabar, Code11, Code128, Code39, Code39 extended, Code93, Code93 extended Interleaved 2of5, Standard2of5, MSI, UPCA, UPCE ... and more
BarCodeBuilder b = new BarCodeBuilder(); b.setSymbology(Symbology.CODE128); b.setCodeText("12345678"); try { b.save("c:\\test.bmp"); b.save("c:\\test.png"); } catch(Exception ex) { ex.printStackTrace(); }
public void paint(Graphics g) { BarCodeBuilder b = new BarCodeBuilder(); b.setSymbology(Symbology.CODE128); b.setCodeText("12345678"); b.render(g); }
Field Summary | |
static int |
AZTECERRORLEVEL_HIGH
Specifies high error correction for Aztec type of barcode |
static int |
AZTECERRORLEVEL_LOW
Specifies low level error correction for Aztec type of barcode |
static int |
AZTECERRORLEVEL_MAX
Specifies max error correction for Aztec type of barcode |
static int |
AZTECERRORLEVEL_MEDIUM
Specifies medium level error correction for Aztec type of barcode |
static int |
AZTECERRORLEVEL_MIN
Specifies minimun error correction for Aztec type of barcode |
static int |
CODABARSYMBOL_A
Specifies Codabar type of barcode's start symbol and stop symbol to be A |
static int |
CODABARSYMBOL_B
Specifies Codabar type of barcode's start symbol and stop symbol to be B |
static int |
CODABARSYMBOL_C
Specifies Codabar type of barcode's start symbol and stop symbol to be C |
static int |
CODABARSYMBOL_D
Specifies Codabar type of barcode's start symbol and stop symbol to be D |
static int |
DATAMATRIXMODE_ASCII
Specifies encoding one alphanumeric or two numeric characters per byte for datamatrix type of barcode |
static int |
DATAMATRIXMODE_AUTO
Specifies automatically pick up the best encode mode for datamatrix type of barcode. |
static int |
DATAMATRIXMODE_FULL
Specifies encoding 8 bit values for datamatrix type of barcode |
static int |
GRAPHICSUNIT_DISPLAY
Specifies the unit of measure of the display device. |
static int |
GRAPHICSUNIT_DOCUMENT
Specifies the document unit (1/300 inch) as the unit of measure. |
static int |
GRAPHICSUNIT_INCH
Specifies the inch as the unit of measure |
static int |
GRAPHICSUNIT_MILIMETER
Specifies the milimeter as the unit of measure |
static int |
GRAPHICSUNIT_PIXEL
Specifies x device pixel as the unit of measure |
static int |
GRAPHICSUNIT_POINT
Specifies x printer's point (1/72 inch) as the unit of measure |
static int |
IMAGEQUALITY_ANTIALIAS
Specifies image quality mode to be anti-alias |
static int |
IMAGEQUALITY_DEFAULT
Specifies image quality mode to be default |
static int |
ITF14BORDERTYPE_BAR
Specifies ITF14 type of barcode with two horizontal guarding bars |
static int |
ITF14BORDERTYPE_FRAME
Specifies ITF14 type of barcode with framing borders. |
static int |
ITF14BORDERTYPE_NONE
Specifies ITF14 type of barcode without borders. |
static int |
PDF417COMPACTMODE_AUTO
Specifies auto detect compaction mode for PDF417 type of barcode |
static int |
PDF417COMPACTMODE_BINARY
Specifies binary compaction mode for PDF417 type of barcode |
static int |
PDF417COMPACTMODE_NUMERIC
Specifies numeric compaction mode for PDF417 type of barcode |
static int |
PDF417COMPACTMODE_TEXT
Specifies text compaction mode for PDF417 type of barcode |
static int |
PDF417ERRORLEVEL_0
Specifies error correction level 0 for PDF417 type of barcode |
static int |
PDF417ERRORLEVEL_1
Specifies error correction level 1 for PDF417 type of barcode |
static int |
PDF417ERRORLEVEL_2
Specifies error correction level 2 for PDF417 type of barcode |
static int |
PDF417ERRORLEVEL_3
Specifies error correction level 3 for PDF417 type of barcode |
static int |
PDF417ERRORLEVEL_4
Specifies error correction level 4 for PDF417 type of barcode |
static int |
PDF417ERRORLEVEL_5
Specifies error correction level 5 for PDF417 type of barcode |
static int |
PDF417ERRORLEVEL_6
Specifies error correction level 6 for PDF417 type of barcode |
static int |
PDF417ERRORLEVEL_7
Specifies error correction level 7 for PDF417 type of barcode |
static int |
PDF417ERRORLEVEL_8
Specifies error correction level 8 ( highest level ) for PDF417 type of barcode |
static int |
QRERRORLEVEL_H
Specifies recovery of 30% of QR type of barcode |
static int |
QRERRORLEVEL_L
Specifies recovery of 7% of QR type of barcode |
static int |
QRERRORLEVEL_M
Specifies recovery of 15% of QR type of barcode |
static int |
QRERRORLEVEL_Q
Specifies recovery of 25% of QR type of barcode |
static long |
SYMBOLOGY_AZTEC
Specifies |
static long |
SYMBOLOGY_CODABAR
Specifies |
static long |
SYMBOLOGY_CODE11
Specifies |
static long |
SYMBOLOGY_CODE39EXTENDED
Specifies |
static long |
SYMBOLOGY_CODE39STANDARD
Specifies |
static long |
SYMBOLOGY_CODE93EXTENDED
Specifies |
static long |
SYMBOLOGY_CODE93STANDARD
Specifies |
static long |
SYMBOLOGY_DATAMATRIX
Specifes |
static long |
SYMBOLOGY_EAN128
Specifes |
static long |
SYMBOLOGY_EAN13
Specifies |
static long |
SYMBOLOGY_EAN14
Specifies |
static long |
SYMBOLOGY_EAN8
Specifies |
static long |
SYMBOLOGY_INTERLEAVED2OF5
Specifies |
static long |
SYMBOLOGY_ITF14
Specifes |
static long |
SYMBOLOGY_MSI
Specifies |
static long |
SYMBOLOGY_ONECODE
Specifies |
static long |
SYMBOLOGY_PDF417
Specifies |
static long |
SYMBOLOGY_PLANET
Specifies |
static long |
SYMBOLOGY_POSTNET
Specifies |
static long |
SYMBOLOGY_QR
Specifies |
static long |
SYMBOLOGY_SSCC18
Specifies |
static long |
SYMBOLOGY_STANDARD2OF5
Specifies |
static long |
SYMBOLOGY_UPCA
Specifies |
static long |
SYMBOLOGY_UPCE
Specifies |
static int |
TEXTALIGN_CENTER
Specifies text should align to the center |
static int |
TEXTALIGN_LEFT
Specifies text should align to the left |
static int |
TEXTALIGN_RIGHT
Specifies text should align to the right. |
Constructor Summary | |
BarCodeBuilder()
Constructs x BarCodeBuilder |
|
BarCodeBuilder(int symbology,
java.lang.String codeText)
Constructs x BarCodeBuilder with specific Symbology and CodeText |
Method Summary | |
java.awt.Image |
generateBarCodeImage()
Returns an Image instance of the barcode image |
int |
getAustraliaPostFormatControlCode()
|
boolean |
getAutoSize()
Gets whether auto sizing the barcode image or not. |
int |
getAztecErrorLevel()
Gets Aztec barcode's error correction level |
java.awt.Color |
getBackColor()
Gets the background color of the barcode image, default to white |
float |
getBarHeight()
Gets the bar's height for 1D barcodes, measured in com.aspose.barcode.GraphicsUnit |
java.awt.Color |
getBorderColor()
Gets border's color of the barcode image |
boolean |
getBorderVisible()
Gets whether to draw the border or not |
float |
getBorderWidth()
Gets border's width of x barcode image. measured by GraphicsUnit, defaulted: millimeter |
Caption |
getCaptionAbove()
Gets CaptionAbove of the barcode image. |
Caption |
getCaptionBelow()
Gets the caption below the barcode image |
int |
getCodabarStartSymbol()
Gets the start symbol for codabar types of barcode |
int |
getCodabarStopSymbol()
Gets the stop symbol of codabar types of barcode |
int |
getCode128Set()
Gets code set for code128 types of barcode |
java.lang.String |
getCodeText()
Gets the code text of the barcode, code text is the data encoded into the barcode image Some barcode symbologies may require certain types of code text, such as UPCA and UPCE require numbers only |
java.awt.Color |
getCodeTextColor()
Gets the human readable code text's color |
java.awt.Font |
getCodeTextFont()
Gets the code text's font of x barcode. barcode image normally has human readable code text printed along with the machine readable barcode. |
boolean |
getCodeTextVisible()
Gets whether or not to show the human readable code text |
int |
getDataMatrixMode()
Gets Datamatrix barcode's encode mode. |
boolean |
getEnableChecksum()
Gets whether checksum is enabled. |
java.awt.Color |
getForeColor()
Gets the foreground color of the barcode image, if it's for web servlet render caption's color and code text's color may be all reduced to one color |
int |
getGraphicsUnit()
Gets the measurement of graphics unit, default to millimeter |
float |
getHeight()
Gets the height of x barcode image. |
int |
getImageQuality()
Gets the image quality of the barcode image, it's not recommended to use the anti alias setting, that will make the barcode image harder to read by machine |
int |
getITF14BorderType()
Gets ITF14 barcode's border type |
int |
getMacroPDF417FileID()
Gets macro pdf417 barcode's file ID. |
boolean |
getMacroPDF417LastSegment()
Gets whether this macro pdf417 barcode is the last segment. |
int |
getMacroPDF417SegmentID()
Gets macro pdf417 barcode's segment ID, which starts from 0, to MacroPdf417SegmentCount - 1. |
Margins |
getMargins()
Gets the marginal size of an barcode image, the area around the barcode. |
float |
getPDF417AspectRatio()
Gets PDF417 barcode's module height to width ratio |
int |
getPDF417Columns()
Gets columns of PDF417 barcode, illegal settings will be ignored |
int |
getPDF417CompactMode()
Gets compaction mode of PDF417 barcode, available modes are PDF417CompactMode.AUTO, PDF417CompactMode.BINARY, PDF417CompactMode.NUMERIC, PDF417CompactMode.TEXT |
int |
getPDF417ErrorLevel()
Gets error correction level of PDF417 barcode, from LEVEL0 to LEVEL8, LEVEL 0 for no error correction, LEVEL8 for max error correction. |
int |
getPDF417Rows()
Gets rows of PDF417 barcode, illegal settings will be ignored |
boolean |
getPDF417Truncated()
Gets whether PDF417 barcode is truncated, that is, the right guard area om |
float |
getPlanetShortBarHeight()
Gets the short bar's height of Planet type of barcode, to set up tall bar's height, use setBarHeight and getBarHeight. |
float |
getPostnetShortBarHeight()
Gets the short bar's height of Postnet type of barcode, to set up tall bar's height, use setBarHeight and getBarHeight. |
int |
getQRErrorLevel()
Gets QR barcode's error correction level. |
Resolution |
getResolution()
Gets the resolution of the barcode image |
float |
getRotationAngle()
Gets the rotation angle of the barcode image defaults to 0 degree |
float |
getSupplementSpace()
Gets the space between main barcode and the supplement barcode |
java.lang.String |
getSupplementText()
Gets the supplement barcode's code text. |
java.lang.String[] |
getSupportedImageFormats()
Gets supporting image format (suffixes) by Save method |
long |
getSymbology()
Gets the symbology of BarCodeBuilder. |
float |
getWideNarrowRatio()
Gets wide bars to narrow bars ratio for some types of one dimensional barcode |
float |
getWidth()
Gets the width of x barcode image. |
float |
getXDimension()
Gets the width of x smallest bar, or the smallest module's width of 2D barcodes measured in GraphicsUnit |
float |
getYDimension()
Gets the height of x smallest module of 2D barcodes. |
void |
render(java.awt.Graphics g)
Renders barcode by Graphics g |
void |
render(java.awt.Graphics2D g)
Renders barcode by Graphics2D g |
void |
render(javax.servlet.http.HttpServletResponse response)
Renders barcode to servlet |
void |
save(java.io.File file,
java.lang.String imageFormat)
Saves the barcode image to file |
void |
save(java.lang.String filename)
Saves the barcode image to file |
void |
save(java.lang.String filename,
java.lang.String imageFormat)
Saves the barcode image to file |
void |
setAustraliaPostFormatControlCode(int australiaPostFormatControlCode)
|
void |
setAutoSize(boolean value)
Sets whether auto sizing the barcode image or not. |
void |
setAztecErrorLevel(int value)
Sets Aztec barcode's error correction level |
void |
setBackColor(java.awt.Color value)
Sets the background color of the barcode image, default to white |
void |
setBarHeight(float value)
Sets the bar's height for 1D barcodes, measured in com.aspose.barcode.GraphicsUnit |
void |
setBorderColor(java.awt.Color value)
Sets border's color of the barcode image |
void |
setBorderVisible(boolean value)
Sets whether to draw the border or not |
void |
setBorderWidth(float value)
Sets border's width of x barcode image. measured by GraphicsUnit, defaulted: millimeter |
void |
setCaptionAbove(Caption value)
Sets the CaptionAbove of the barcode image. |
void |
setCaptionBelow(Caption value)
Sets the caption below the barcode image |
void |
setCodabarStartSymbol(int value)
Sets the start symbol for codabar types of barcode |
void |
setCodabarStopSymbol(int value)
Sets the stop symbol of codabar types of barcode |
void |
setCode128Set(int value)
Sets code set for code128 types of barcode |
void |
setCodeText(java.lang.String value)
Sets the code text of the barcode, code text is the data encoded into the barcode image If code text is null or empty, exception will be thrown. |
void |
setCodeTextColor(java.awt.Color value)
Sets the human readable code text's color |
void |
setCodeTextFont(java.awt.Font value)
Sets the code text's font of x barcode. barcode image normally has human readable code text printed along with the machine readable barcode. |
void |
setCodeTextVisible(boolean value)
Sets whether or not to show the human readable code text, some symbologies of barcode may ignore this setting |
void |
setDataMatrixMode(int value)
Sets Datamatrix barcode's encode mode |
void |
setEnableChecksum(boolean value)
Sets wether checksum is enabled. |
void |
setForeColor(java.awt.Color value)
Gets the foreground color of the barcode image, if it's for web servlet render caption's color and code text's color may be all reduced to one color |
void |
setGraphicsUnit(int value)
Sets the measurement of graphics unit, default to millimeter |
void |
setHeight(float value)
Sets the height of x barcode image, if auto size is set to true, Width and Height settings will be ignored |
void |
setImageQuality(int value)
Sets the image quality of the barcode image, it's not recommended to use the anti alias setting, that will make the barcode image harder to read by machine |
void |
setITF14BorderType(int value)
Sets ITF14 barcode's border type |
void |
setMacroPDF417FileID(int macroPDF417FileID)
Sets macro pdf417 barcode's file ID. |
void |
setMacroPDF417LastSegment(boolean isMacroPDF417LastSegment)
Getswhether this macro pdf417 barcode is the last segment. |
void |
setMacroPDF417SegmentID(int macroPDF417SegmentID)
Sets macro pdf417 barcode's segment ID, which starts from 0, to MacroPdf417SegmentCount - 1. |
void |
setMargins(Margins value)
Sets the marginal size of an barcode image, the area around the barcode. |
void |
setPDF417AspectRatio(float value)
Sets PDF417 barcode's module height to width ratio |
void |
setPDF417Columns(int value)
Sets columns of PDF417 barcode, illegal settings will be ignored |
void |
setPDF417CompactMode(int value)
Sets compaction mode of PDF417 barcode, available modes are PDF417CompactMode.AUTO, PDF417CompactMode.BINARY, PDF417CompactMode.NUMERIC, PDF417CompactMode.TEXT |
void |
setPDF417ErrorLevel(int value)
Sets error correction level of PDF417 barcode, from LEVEL0 to LEVEL8, LEVEL 0 for no error correction, LEVEL8 for max error correction. |
void |
setPDF417Rows(int value)
Sets rows of PDF417 barcode, illegal settings will be ignored |
void |
setPDF417Truncated(boolean value)
Sets whether PDF417 barcode is truncated. |
void |
setPlanetShortBarHeight(float value)
Sets the short bar's height of Planet type of barcode, to set up tall bar's height, use setBarHeight and getBarHeight. |
void |
setPostnetShortBarHeight(float value)
Sets the short bar's height of Postnet type of barcode, to set up tall bar's height, use setBarHeight and getBarHeight method. |
void |
setQRErrorLevel(int value)
Sets QR barcode's error correction level. |
void |
setResolution(Resolution value)
Sets the resolution of the barcode image |
void |
setRotationAngle(float value)
Sets the rotation angle of the barcode image, default to 0 degree, if rotation angle not not equal to 0, 90, 180 or 270, the barcode maybe jagged, setImageQuality to anti-alias to solve this problem |
void |
setSupplementSpace(float value)
Sets the space between main barcode and the supplement barcode |
void |
setSupplementText(java.lang.String value)
Sets the supplement barcode's code text. |
void |
setSymbology(long value)
Sets the symbology of BarCodeBuilder. |
void |
setWideNarrowRatio(float value)
Sets wide bars to narrow bars ratio for some types of one dimensional barcode, default to 3.0 |
void |
setWidth(float value)
Sets the width of x barcode image, if auto size is set to true, Width and Height settings will be ignored |
void |
setXDimension(float value)
Sets the width of x smallest bar, or the smallest module's width of 2D barcodes measured in GraphicsUnit |
void |
setYDimension(float value)
Sets the height of x smallest module of 2D barcodes. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final long SYMBOLOGY_CODABAR
com.aspose.barcode.Symbology.CODABAR
,
Constant Field Valuespublic static final long SYMBOLOGY_CODE11
com.aspose.barcode.Symbology.CODE11
,
Constant Field Valuespublic static final long SYMBOLOGY_CODE39EXTENDED
com.aspose.barcode.Symbology.CODE39EXTENDED
,
Constant Field Valuespublic static final long SYMBOLOGY_CODE39STANDARD
com.aspose.barcode.Symbology.CODE39STANDARD
,
Constant Field Valuespublic static final long SYMBOLOGY_CODE93EXTENDED
com.aspose.barcode.Symbology.CODE93EXTENDED
,
Constant Field Valuespublic static final long SYMBOLOGY_CODE93STANDARD
com.aspose.barcode.Symbology.CODE93STANDARD
,
Constant Field Valuespublic static final long SYMBOLOGY_EAN13
com.aspose.barcode.Symbology.EAN13
,
Constant Field Valuespublic static final long SYMBOLOGY_EAN8
com.aspose.barcode.Symbology.EAN8
,
Constant Field Valuespublic static final long SYMBOLOGY_INTERLEAVED2OF5
com.aspose.barcode.Symbology.INTERLEAVED2OF5
,
Constant Field Valuespublic static final long SYMBOLOGY_MSI
com.aspose.barcode.Symbology.MSI
,
Constant Field Valuespublic static final long SYMBOLOGY_STANDARD2OF5
com.aspose.barcode.Symbology.STANDARD2OF5
,
Constant Field Valuespublic static final long SYMBOLOGY_UPCA
com.aspose.barcode.Symbology.UPCA
,
Constant Field Valuespublic static final long SYMBOLOGY_UPCE
com.aspose.barcode.Symbology.UPCE
,
Constant Field Valuespublic static final long SYMBOLOGY_EAN128
com.aspose.barcode.Symbology.EAN128
,
Constant Field Valuespublic static final long SYMBOLOGY_PDF417
com.aspose.barcode.Symbology.PDF417
,
Constant Field Valuespublic static final long SYMBOLOGY_DATAMATRIX
com.aspose.barcode.Symbology.DATAMATRIX
,
Constant Field Valuespublic static final long SYMBOLOGY_AZTEC
com.aspose.barcode.Symbology.AZTEC
,
Constant Field Valuespublic static final long SYMBOLOGY_QR
com.aspose.barcode.Symbology.QR
,
Constant Field Valuespublic static final long SYMBOLOGY_ITF14
com.aspose.barcode.Symbology.ITF14
,
Constant Field Valuespublic static final long SYMBOLOGY_EAN14
com.aspose.barcode.Symbology.EAN14
,
Constant Field Valuespublic static final long SYMBOLOGY_SSCC18
com.aspose.barcode.Symbology.SSCC18
,
Constant Field Valuespublic static final long SYMBOLOGY_PLANET
com.aspose.barcode.Symbology.PLANET
,
Constant Field Valuespublic static final long SYMBOLOGY_POSTNET
com.aspose.barcode.Symbology.POSTNET
,
Constant Field Valuespublic static final long SYMBOLOGY_ONECODE
com.aspose.barcode.Symbology.ONECODE
,
Constant Field Valuespublic static final int CODABARSYMBOL_A
com.aspose.barcode.CodabarSymbol.A
,
Constant Field Valuespublic static final int CODABARSYMBOL_B
com.aspose.barcode.CodabarSymbol.B
,
Constant Field Valuespublic static final int CODABARSYMBOL_C
com.aspose.barcode.CodabarSymbol.C
,
Constant Field Valuespublic static final int CODABARSYMBOL_D
com.aspose.barcode.CodabarSymbol.D
,
Constant Field Valuespublic static final int GRAPHICSUNIT_DISPLAY
com.aspose.barcode.GraphicsUnit.DISPLAY
,
Constant Field Valuespublic static final int GRAPHICSUNIT_DOCUMENT
com.aspose.barcode.GraphicsUnit.DOCUMENT
,
Constant Field Valuespublic static final int GRAPHICSUNIT_INCH
com.aspose.barcode.GraphicsUnit.INCH
,
Constant Field Valuespublic static final int GRAPHICSUNIT_MILIMETER
com.aspose.barcode.GraphicsUnit.MILIMETER
,
Constant Field Valuespublic static final int GRAPHICSUNIT_PIXEL
com.aspose.barcode.GraphicsUnit.PIXEL
,
Constant Field Valuespublic static final int GRAPHICSUNIT_POINT
com.aspose.barcode.GraphicsUnit.POINT
,
Constant Field Valuespublic static final int TEXTALIGN_CENTER
com.aspose.barcode.TextAlign.CENTER
,
Constant Field Valuespublic static final int TEXTALIGN_LEFT
com.aspose.barcode.TextAlign.LEFT
,
Constant Field Valuespublic static final int TEXTALIGN_RIGHT
com.aspose.barcode.TextAlign.RIGHT
,
Constant Field Valuespublic static final int IMAGEQUALITY_DEFAULT
com.aspose.barcode.ImageQuality.DEFAULT
,
Constant Field Valuespublic static final int IMAGEQUALITY_ANTIALIAS
com.aspose.barcode.ImageQuality.ANTI_ALIAS
,
Constant Field Valuespublic static final int ITF14BORDERTYPE_NONE
com.aspose.barcode.ITF14BorderType.NONE
,
Constant Field Valuespublic static final int ITF14BORDERTYPE_FRAME
com.aspose.barcode.ITF14BorderType.FRAME
,
Constant Field Valuespublic static final int ITF14BORDERTYPE_BAR
com.aspose.barcode.ITF14BorderType.BAR
,
Constant Field Valuespublic static final int PDF417COMPACTMODE_AUTO
com.aspose.barcode.PDF417CompactMode.AUTO
,
Constant Field Valuespublic static final int PDF417COMPACTMODE_TEXT
com.aspose.barcode.PDF417CompactMode.TEXT
,
Constant Field Valuespublic static final int PDF417COMPACTMODE_NUMERIC
com.aspose.barcode.PDF417CompactMode.NUMERIC
,
Constant Field Valuespublic static final int PDF417COMPACTMODE_BINARY
com.aspose.barcode.PDF417CompactMode.BINARY
,
Constant Field Valuespublic static final int PDF417ERRORLEVEL_0
com.aspose.barcode.PDF417ErrorLevel.LEVEL0
,
Constant Field Valuespublic static final int PDF417ERRORLEVEL_1
com.aspose.barcode.PDF417ErrorLevel.LEVEL1
,
Constant Field Valuespublic static final int PDF417ERRORLEVEL_2
com.aspose.barcode.PDF417ErrorLevel.LEVEL2
,
Constant Field Valuespublic static final int PDF417ERRORLEVEL_3
com.aspose.barcode.PDF417ErrorLevel.LEVEL3
,
Constant Field Valuespublic static final int PDF417ERRORLEVEL_4
com.aspose.barcode.PDF417ErrorLevel.LEVEL4
,
Constant Field Valuespublic static final int PDF417ERRORLEVEL_5
com.aspose.barcode.PDF417ErrorLevel.LEVEL5
,
Constant Field Valuespublic static final int PDF417ERRORLEVEL_6
com.aspose.barcode.PDF417ErrorLevel.LEVEL6
,
Constant Field Valuespublic static final int PDF417ERRORLEVEL_7
com.aspose.barcode.PDF417ErrorLevel.LEVEL7
,
Constant Field Valuespublic static final int PDF417ERRORLEVEL_8
com.aspose.barcode.PDF417ErrorLevel.LEVEL8
,
Constant Field Valuespublic static final int QRERRORLEVEL_L
com.aspose.barcode.QRErrorLevel.LEVEL_L
,
Constant Field Valuespublic static final int QRERRORLEVEL_M
com.aspose.barcode.QRErrorLevel.LEVEL_M
,
Constant Field Valuespublic static final int QRERRORLEVEL_Q
com.aspose.barcode.QRErrorLevel.LEVEL_Q
,
Constant Field Valuespublic static final int QRERRORLEVEL_H
com.aspose.barcode.QRErrorLevel.LEVEL_H
,
Constant Field Valuespublic static final int DATAMATRIXMODE_AUTO
com.aspose.barcode.DataMatrixMode.AUTO
,
Constant Field Valuespublic static final int DATAMATRIXMODE_ASCII
com.aspose.barcode.DataMatrixMode.ASCII
,
Constant Field Valuespublic static final int DATAMATRIXMODE_FULL
com.aspose.barcode.DataMatrixMode.FULL
,
Constant Field Valuespublic static final int AZTECERRORLEVEL_MIN
com.aspose.barcode.AztecErrorLevel.MIN
,
Constant Field Valuespublic static final int AZTECERRORLEVEL_LOW
com.aspose.barcode.AztecErrorLevel.LOW
,
Constant Field Valuespublic static final int AZTECERRORLEVEL_MEDIUM
com.aspose.barcode.AztecErrorLevel.MEDIUM
,
Constant Field Valuespublic static final int AZTECERRORLEVEL_HIGH
com.aspose.barcode.AztecErrorLevel.HIGH
,
Constant Field Valuespublic static final int AZTECERRORLEVEL_MAX
com.aspose.barcode.AztecErrorLevel.MAX
,
Constant Field ValuesConstructor Detail |
public BarCodeBuilder()
public BarCodeBuilder(int symbology, java.lang.String codeText)
symbology
- Symbology of barcodecodeText
- Data to be encodedSymbology
Method Detail |
public long getSymbology()
Codabar, Code11, Code128, Code39, Code39 extended, Code93, Code93 extended Interleaved 2of5, Standard2of5, MSI, UPCA, UPCE
BarCodeBuilder b = new BarCodeBuilder(); if(b.getSymbology() != Symbology.CODE128) { b.setSymbology(Symbology.CODE128) }
Symbology
,
setSymbology(long value)
public void setSymbology(long value)
Codabar, Code11, Code128, Code39, Code39 extended, Code93, Code93 extended Interleaved 2of5, Standard2of5, MSI, UPCA, UPCE
value
- from com.aspose.barcode.Symbology
BarCodeBuilder b = new BarCodeBuilder(); if(b.getSymbology() != Symbology.CODE128) { b.setSymbology(Symbology.CODE128) }
getSymbology()
,
Symbology
public Caption getCaptionAbove()
BarCodeBuilder b = new BarCodeBuilder(); b.getCaptionAbove().setText("This is the caption above");
setCaptionAbove(Caption)
,
Caption
,
setCaptionBelow(Caption)
,
getCaptionBelow()
public void setCaptionAbove(Caption value)
BarCodeBuilder b = new BarCodeBuilder(); b.setCaptionAbove(new Caption("this is x caption"));
value
- of com.aspose.barcode.CaptionCaption
,
getCaptionAbove()
,
getCaptionBelow()
,
setCaptionBelow(Caption)
public Caption getCaptionBelow()
BarCodeBuilder b = new BarCodeBuilder(); b.getCaptionBelow().setVisible(false);
Caption
,
setCaptionBelow(Caption)
,
getCaptionAbove()
,
setCaptionAbove(Caption)
public void setCaptionBelow(Caption value)
BarCodeBuilder b = new BarCodeBuilder(); b.setCaptionBelow(new Caption("Caption below the barcode image"));
value
- of com.aspose.barcode.CaptiongetCaptionBelow()
,
setCaptionAbove(Caption)
,
getCaptionAbove()
,
Caption
public java.lang.String getCodeText()
setCodeText(String)
public void setCodeText(java.lang.String value)
BarCodeBuilder b = new BarCodeBuilder(); b.setCodeText("12345678"); b.setSymbology(Symbology.UPCA); try { b.save("test.jpg"); } catch(Exception ex) { ex.printStackTrace(); }
value
- of StringgetCodeText()
public java.awt.Font getCodeTextFont()
Font
,
setCodeTextFont(Font)
public void setCodeTextFont(java.awt.Font value)
BarCodeBuilder b = new BarCodeBuilder(); b.setCodeTextFont(new Font("Serif", Font.BOLD + Font.ITALIC, 20));
value
- of java.awt.FontFont
,
getCodeTextFont()
public boolean getBorderVisible()
setBorderVisible(boolean)
,
getBorderColor()
,
getBorderWidth()
,
setBorderColor(Color)
,
setBorderWidth(float)
public void setBorderVisible(boolean value)
value
- of booleangetBorderVisible()
,
getBorderColor()
,
getBorderWidth()
,
setBorderColor(Color)
,
setBorderWidth(float)
public float getBorderWidth()
GraphicsUnit
,
getBorderColor()
,
setBorderColor(Color)
,
getBorderVisible()
,
setBorderVisible(boolean)
public void setBorderWidth(float value)
value
- greater or equal to zeroGraphicsUnit
,
getBorderColor()
,
setBorderColor(Color)
,
getBorderVisible()
,
setBorderVisible(boolean)
public boolean getEnableChecksum()
public void setEnableChecksum(boolean value)
public Margins getMargins()
Margins
,
setMargins(Margins)
public void setMargins(Margins value)
getMargins()
,
Margins
public float getRotationAngle()
public void setRotationAngle(float value)
value
- of float, rotation angleImageQuality
,
getRotationAngle()
public float getXDimension()
GraphicsUnit
,
setXDimension(float)
public void setXDimension(float value)
BarCodeBuilder b = new BarCodeBuilder(); b.setGraphicsUnit(GraphicsUnit.MILIMETER); b.setXDimension(0.5f);
value
- of float, xDimension values measured in com.aspose.barcode.GraphicsUnitpublic float getYDimension()
public void setYDimension(float value)
value
- of floatpublic float getBarHeight()
setBarHeight(float)
,
GraphicsUnit
public void setBarHeight(float value)
BarCodeBuilder b = new BarCodeBuilder(); b.setGraphicsUnit(GraphicsUnit.MILIMETER); b.setBarHeight(20f);
value
- of float, bar's height of one dimensional barcodepublic int getGraphicsUnit()
GraphicsUnit
public void setGraphicsUnit(int value)
BarCodeBuilder b = new BarCodeBuilder(); //graphics unit set to pixel b.setGraphicsUnit(GraphicsUnit.PIXEL); //the smallest bar's width will be 2 pixel b.setXDimension(2); //bar's height of one dimensional barcode will be 20 pixels b.setBarHeight(20);
value
- of int, com.aspose.barcode.GraphicsUnitGraphicsUnit
public java.awt.Color getForeColor()
setForeColor(Color)
public void setForeColor(java.awt.Color value)
value
- of Color, java.awt.ColorColor
,
setForeColor(Color)
public java.awt.Color getBackColor()
Color
,
getForeColor()
public void setBackColor(java.awt.Color value)
BarCodeBuilder b = new BarCodeBuilder(); b.setBackColor(Color.WHITE);
value
- of Color, java.awt.ColorColor
,
getBackColor()
public java.awt.Color getCodeTextColor()
setCodeTextColor(Color)
,
Color
public void setCodeTextColor(java.awt.Color value)
value
- of Color, java.awt.ColorsetCodeTextColor(Color)
public Resolution getResolution()
BarCodeBuilder b = new BarCodeBuilder(); b.getResolution().setDpiX(96); b.getResolution().setDpiY(96);
setResolution(Resolution)
,
Resolution
public void setResolution(Resolution value)
BarCodeBuilder b = new BarCodeBuilder(); b.setResolution(new Resolution(96, 96));
value
- of Resolution, com.aspose.barcode.ResolutionResolution
,
getResolution()
public boolean getCodeTextVisible()
setCodeTextVisible(boolean)
public void setCodeTextVisible(boolean value)
getCodeTextVisible()
public int getImageQuality()
setImageQuality(int)
,
ImageQuality
public void setImageQuality(int value)
BarCodeBuilder b = new BarCodeBuilder(); b.setImageQuality(ImageQuality.ANTI_ALIAS);
value
- of ImageQuality, com.aspose.barcode.ImageQualityImageQuality
public int getCodabarStartSymbol()
CodabarSymbol
public void setCodabarStartSymbol(int value)
BarCodeBuilder b = new BarCodeBuilder(); b.setCodabarStartSymbol(CodabarSymbol.A);
value
- of CodabarSymbol, com.aspose.barcode.CodabarSymbolCodabarSymbol
public int getCodabarStopSymbol()
CodabarSymbol
,
setCodabarStopSymbol(int)
public void setCodabarStopSymbol(int value)
BarCodeBuilder b = new BarCodeBuilder(); b.setCodabarStopSymbol(CodabarSymbol.A);
value
- of CodarbarSymbol, com.aspose.barcode.CodarbarSymbolCodabarSymbol
,
getCodabarStopSymbol()
public int getCode128Set()
Code128Set
public void setCode128Set(int value)
BarCodeBuilder b = new BarCodeBuilder(); b.setSymbology(Symbology.CODE128); b.setCode128Set(Code128Set.AUTO);
value
- of Code128Set, com.aspose.barcode.Code128SetCode128Set
public float getWideNarrowRatio()
setWideNarrowRatio(float)
public void setWideNarrowRatio(float value)
getWideNarrowRatio()
public boolean getAutoSize()
setWidth(float)
,
setHeight(float)
public void setAutoSize(boolean value)
setWidth(float)
,
setHeight(float)
public float getWidth()
setWidth(float)
public void setWidth(float value)
setAutoSize(boolean)
,
getWidth()
public float getHeight()
setHeight(float)
public void setHeight(float value)
getHeight()
,
setAutoSize(boolean)
public java.awt.Color getBorderColor()
setBorderColor(Color)
public void setBorderColor(java.awt.Color value)
value
- of Color, java.awt.ColorColor
public int getITF14BorderType()
ITF14BorderType
public void setITF14BorderType(int value)
value
- of ITF14BorderTypeITF14BorderType
public int getPDF417ErrorLevel()
PDF417ErrorLevel
public void setPDF417ErrorLevel(int value)
value
- PDF417ErrorLevel
public int getPDF417CompactMode()
PDF417CompactMode
public void setPDF417CompactMode(int value)
value
- of intPDF417CompactMode
public int getPDF417Rows()
public void setPDF417Rows(int value)
value
- public int getPDF417Columns()
public void setPDF417Columns(int value)
value
- public boolean getPDF417Truncated()
public void setPDF417Truncated(boolean value)
value
- of booleanpublic float getPDF417AspectRatio()
setPDF417AspectRatio(float)
public void setPDF417AspectRatio(float value)
value
- of floatgetPDF417AspectRatio()
public int getQRErrorLevel()
QRErrorLevel
,
setQRErrorLevel(int)
public void setQRErrorLevel(int value)
value
- of intQRErrorLevel
,
getQRErrorLevel()
public int getDataMatrixMode()
DataMatrixMode
,
setDataMatrixMode(int)
public void setDataMatrixMode(int value)
value
- DataMatrixMode
,
getDataMatrixMode()
public int getAztecErrorLevel()
setAztecErrorLevel(int)
,
AztecErrorLevel
public void setAztecErrorLevel(int value)
value
- of intgetAztecErrorLevel()
,
AztecErrorLevel
public float getPlanetShortBarHeight()
setPlanetShortBarHeight(float)
,
setBarHeight(float)
public void setPlanetShortBarHeight(float value)
value
- getPlanetShortBarHeight()
,
setBarHeight(float)
public float getPostnetShortBarHeight()
setPostnetShortBarHeight(float)
public void setPostnetShortBarHeight(float value)
value
- getPostnetShortBarHeight()
public float getSupplementSpace()
setSupplementSpace(float)
public void setSupplementSpace(float value)
value
- getSupplementSpace()
public java.lang.String getSupplementText()
public void setSupplementText(java.lang.String value)
value
- public int getMacroPDF417SegmentID()
public void setMacroPDF417SegmentID(int macroPDF417SegmentID)
macroPDF417SegmentID
- public int getMacroPDF417FileID()
public void setMacroPDF417FileID(int macroPDF417FileID)
macroPDF417FileID
- public boolean getMacroPDF417LastSegment()
public void setMacroPDF417LastSegment(boolean isMacroPDF417LastSegment)
isMacroPDF417LastSegment
- public void save(java.lang.String filename) throws java.io.IOException, BarCodeException
BarCodeBuilder b = new BarCodeBuilder(); b.setSymbology(Symbology.CODE128); b.setCodeText("1234566"); //save as bmp b.save("C:\\test.bmp"); //save as jpg b.save("c:\\test.jpg"); //save to current directory as png b.save("test.png");
filename
- of String, full path of the image including file extension
java.io.IOException
BarCodeException
public java.lang.String[] getSupportedImageFormats()
save(File,String)
,
save(String,String)
public void save(java.lang.String filename, java.lang.String imageFormat) throws java.io.IOException, BarCodeException
BarCodeBuilder b = new BarCodeBuilder(); b.setSymbology(Symbology.CODE128); b.setCodeText("1234566"); //save as bmp b.save("C:\\test.bmp", "bmp"); //save as jpg b.save("c:\\test.jpg", "jpg"); //save to current directory as png b.save("test.png", "png");
filename
- full path of image to be savedimageFormat
- image format such as "bmp", "jpg", "jpeg"
java.io.IOException
BarCodeException
getSupportedImageFormats()
public void save(java.io.File file, java.lang.String imageFormat) throws java.io.IOException, BarCodeException
BarCodeBuilder b = new BarCodeBuilder(); b.setSymbology(Symbology.CODE128); b.setCodeText("1234566"); //save as bmp b.save(new File("C:\\test.bmp"), "bmp");
file
- target fileimageFormat
- image format such as "bmp", "jpg", "jpeg"
java.io.IOException
BarCodeException
public java.awt.Image generateBarCodeImage()
public void render(java.awt.Graphics g)
public class AppletSample extends Applet { public void paint(Graphics g) { BarCodeBuilder b = new BarCodeBuilder(); b.setSymbology(Symbology.CODE128); b.setCodeText("12345678"); b.render(g); } }
g
- java.awt.GraphicsGraphics
public void render(java.awt.Graphics2D g)
g
- java.awt.Graphics2DGraphics2D
public void render(javax.servlet.http.HttpServletResponse response) throws java.io.IOException, javax.servlet.ServletException
import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import com.aspose.barcode.*; public class ServletSample extends HttpServlet { public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { BarCodeBuilder b = new BarCodeBuilder(); b.setSymbology(Symbology.CODE128); b.setCodeText("12345678"); b.render(response); } }
response
- HttpServletResponse
java.io.IOException
javax.servlet.ServletException
HttpServletResponse
public int getAustraliaPostFormatControlCode()
public void setAustraliaPostFormatControlCode(int australiaPostFormatControlCode)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |