|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.aspose.j2me.barcode.generation.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
public void paint(Graphics g) { BarCodeBuilder b = new BarCodeBuilder(); b.setSymbology(Symbology.CODE128); b.setCodeText("12345678"); b.render(g); }
Field Summary | |
static char |
EAN128FNC1
FNC1 character value for EAN128 BarCode |
Constructor Summary | |
BarCodeBuilder()
Constructs x BarCodeBuilder |
|
BarCodeBuilder(long symbology,
java.lang.String codeText)
Constructs x BarCodeBuilder with specific Symbology and CodeText |
Method Summary | |
int |
getAustraliaPostFormatControlCode()
|
boolean |
getAutoSize()
Gets whether auto sizing the barcode image or not. |
int |
getAztecErrorLevel()
Gets Aztec barcode's error correction level |
int |
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 |
int |
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. |
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 |
int |
getCodeTextColor()
Gets the human readable code text's color |
javax.microedition.lcdui.Font |
getCodeTextFont()
Gets the code text's font of x 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. |
int |
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 |
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 |
getSupplementSpace()
Gets the space between main barcode and the supplement barcode |
java.lang.String |
getSupplementText()
Gets the supplement barcode's code text. |
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(javax.microedition.lcdui.Graphics g)
Renders barcode by Graphics g |
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(int 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(int 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. |
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(int value)
Sets the human readable code text's color |
void |
setCodeTextFont(javax.microedition.lcdui.Font value)
Sets the code text's font of x 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(int 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 |
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 |
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 char EAN128FNC1
Constructor Detail |
public BarCodeBuilder()
public BarCodeBuilder(long symbology, java.lang.String codeText)
symbology
- Symbology of barcodecodeText
- Data to be encodedMethod 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) }
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 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 javax.microedition.lcdui.Font getCodeTextFont()
setCodeTextFont(Font)
public void setCodeTextFont(javax.microedition.lcdui.Font value)
BarCodeBuilder b = new BarCodeBuilder(); b.setCodeTextFont(new Font("Serif", Font.BOLD + Font.ITALIC, 20));
value
- of java.awt.FontgetCodeTextFont()
public boolean getBorderVisible()
setBorderVisible(boolean)
,
getBorderColor()
,
getBorderWidth()
,
setBorderWidth(float)
public void setBorderVisible(boolean value)
value
- of booleangetBorderVisible()
,
getBorderColor()
,
getBorderWidth()
,
setBorderWidth(float)
public float getBorderWidth()
getBorderColor()
,
getBorderVisible()
,
setBorderVisible(boolean)
public void setBorderWidth(float value)
value
- greater or equal to zerogetBorderColor()
,
getBorderVisible()
,
setBorderVisible(boolean)
public boolean getEnableChecksum()
public void setEnableChecksum(boolean value)
public Margins getMargins()
setMargins(Margins)
public void setMargins(Margins value)
getMargins()
public float getXDimension()
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)
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()
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.GraphicsUnitpublic int getForeColor()
public void setForeColor(int value)
value
- of Color, java.awt.Colorpublic int getBackColor()
getForeColor()
public void setBackColor(int value)
BarCodeBuilder b = new BarCodeBuilder(); b.setBackColor(Color.WHITE);
value
- of Color, java.awt.ColorgetBackColor()
public int getCodeTextColor()
public void setCodeTextColor(int value)
value
- of Color, java.awt.Colorpublic Resolution getResolution()
BarCodeBuilder b = new BarCodeBuilder(); b.getResolution().setDpiX(96); b.getResolution().setDpiY(96);
setResolution(Resolution)
public void setResolution(Resolution value)
BarCodeBuilder b = new BarCodeBuilder(); b.setResolution(new Resolution(96, 96));
value
- of Resolution, com.aspose.barcode.ResolutiongetResolution()
public boolean getCodeTextVisible()
setCodeTextVisible(boolean)
public void setCodeTextVisible(boolean value)
getCodeTextVisible()
public int getCodabarStartSymbol()
public void setCodabarStartSymbol(int value)
BarCodeBuilder b = new BarCodeBuilder(); b.setCodabarStartSymbol(CodabarSymbol.A);
value
- of CodabarSymbol, com.aspose.barcode.CodabarSymbolpublic int getCodabarStopSymbol()
setCodabarStopSymbol(int)
public void setCodabarStopSymbol(int value)
BarCodeBuilder b = new BarCodeBuilder(); b.setCodabarStopSymbol(CodabarSymbol.A);
value
- of CodarbarSymbol, com.aspose.barcode.CodarbarSymbolgetCodabarStopSymbol()
public int getCode128Set()
public void setCode128Set(int value)
BarCodeBuilder b = new BarCodeBuilder(); b.setSymbology(Symbology.CODE128); b.setCode128Set(Code128Set.AUTO);
value
- of Code128Set, com.aspose.barcode.Code128Setpublic 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 int getBorderColor()
public void setBorderColor(int value)
value
- of Color, java.awt.Colorpublic int getITF14BorderType()
public void setITF14BorderType(int value)
value
- of ITF14BorderTypepublic int getPDF417ErrorLevel()
public void setPDF417ErrorLevel(int value)
value
- public int getPDF417CompactMode()
public void setPDF417CompactMode(int value)
value
- of intpublic 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()
setQRErrorLevel(int)
public void setQRErrorLevel(int value)
value
- of intgetQRErrorLevel()
public int getDataMatrixMode()
setDataMatrixMode(int)
public void setDataMatrixMode(int value)
value
- getDataMatrixMode()
public int getAztecErrorLevel()
setAztecErrorLevel(int)
public void setAztecErrorLevel(int value)
value
- of intgetAztecErrorLevel()
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 render(javax.microedition.lcdui.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.Graphicspublic int getAustraliaPostFormatControlCode()
public void setAustraliaPostFormatControlCode(int australiaPostFormatControlCode)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |