|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.aspose.barcode.BarCodeBuilder
public class 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
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 |
CODABARSYMBOL_A
|
static int |
CODABARSYMBOL_B
|
static int |
CODABARSYMBOL_C
|
static int |
CODABARSYMBOL_D
|
static int |
GRAPHICSUNIT_DISPLAY
|
static int |
GRAPHICSUNIT_DOCUMENT
|
static int |
GRAPHICSUNIT_INCH
|
static int |
GRAPHICSUNIT_MILIMETER
|
static int |
GRAPHICSUNIT_PIXEL
|
static int |
GRAPHICSUNIT_POINT
|
static int |
IMAGEQUALITY_ANTIALIAS
|
static int |
IMAGEQUALITY_DEFAULT
|
static int |
SYMBOLOGY_CODABAR
|
static int |
SYMBOLOGY_CODE11
|
static int |
SYMBOLOGY_CODE39EXTENDED
|
static int |
SYMBOLOGY_CODE39STANDARD
|
static int |
SYMBOLOGY_CODE93EXTENDED
|
static int |
SYMBOLOGY_CODE93STANDARD
|
static int |
SYMBOLOGY_EAN13
|
static int |
SYMBOLOGY_EAN8
|
static int |
SYMBOLOGY_INTERLEAVED2OF5
|
static int |
SYMBOLOGY_MSI
|
static int |
SYMBOLOGY_STANDARD2OF5
|
static int |
SYMBOLOGY_UPCA
|
static int |
SYMBOLOGY_UPCE
|
static int |
TEXTALIGN_CENTER
|
static int |
TEXTALIGN_LEFT
|
static int |
TEXTALIGN_RIGHT
|
Constructor Summary | |
---|---|
BarCodeBuilder()
Constructs a BarCodeBuilder |
|
BarCodeBuilder(int symbology,
java.lang.String codeText)
Constructs a BarCodeBuilder with specific Symbology and CodeText |
Method Summary | |
---|---|
java.awt.Image |
generateBarCodeImage()
Returns an Image instance of the barcode image |
boolean |
getAutoSize()
Gets whether auto sizing the barcode image or not. |
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 a barcode image. |
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 a barcode. |
boolean |
getCodeTextVisible()
Gets whether or not to show the human readable code text |
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 a 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 |
Margins |
getMargins()
Gets the marginal size of an barcode image, the area around the barcode. |
Resolution |
getResolution()
Gets the resolution of the barcode image |
float |
getRotationAngle()
Gets the rotation angle of the barcode image defaults to 0 degree |
java.lang.String[] |
getSupportedImageFormats()
Gets supporting image format (suffixes) by Save method |
int |
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 a barcode image. |
float |
getXDimension()
Gets the width of a smallest bar, or the smallest module's width of 2D barcodes measured in GraphicsUnit |
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 |
setAutoSize(boolean value)
Sets whether auto sizing the barcode image or not. |
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 a barcode image. |
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 a 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 |
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 a 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 |
setMargins(Margins value)
Sets the marginal size of an barcode image, the area around the barcode. |
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 |
setSymbology(int 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 a barcode image, if auto size is set to true, Width and Height settings will be ignored |
void |
setXDimension(float value)
Sets the width of a smallest bar, or the smallest module's width of 2D barcodes measured in GraphicsUnit |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int SYMBOLOGY_CODABAR
public static final int SYMBOLOGY_CODE11
public static final int SYMBOLOGY_CODE39EXTENDED
public static final int SYMBOLOGY_CODE39STANDARD
public static final int SYMBOLOGY_CODE93EXTENDED
public static final int SYMBOLOGY_CODE93STANDARD
public static final int SYMBOLOGY_EAN13
public static final int SYMBOLOGY_EAN8
public static final int SYMBOLOGY_INTERLEAVED2OF5
public static final int SYMBOLOGY_MSI
public static final int SYMBOLOGY_STANDARD2OF5
public static final int SYMBOLOGY_UPCA
public static final int SYMBOLOGY_UPCE
public static final int CODABARSYMBOL_A
public static final int CODABARSYMBOL_B
public static final int CODABARSYMBOL_C
public static final int CODABARSYMBOL_D
public static final int GRAPHICSUNIT_DISPLAY
public static final int GRAPHICSUNIT_DOCUMENT
public static final int GRAPHICSUNIT_INCH
public static final int GRAPHICSUNIT_MILIMETER
public static final int GRAPHICSUNIT_PIXEL
public static final int GRAPHICSUNIT_POINT
public static final int TEXTALIGN_CENTER
public static final int TEXTALIGN_LEFT
public static final int TEXTALIGN_RIGHT
public static final int IMAGEQUALITY_DEFAULT
public static final int IMAGEQUALITY_ANTIALIAS
Constructor Detail |
---|
public BarCodeBuilder()
public BarCodeBuilder(int symbology, java.lang.String codeText)
symbology
- Symbology of barcodecodeText
- Data to be encodedSymbology
Method Detail |
---|
public int getSymbology()
Gets the symbology of BarCodeBuilder. Supported Symbologies:
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(int value)
public void setSymbology(int value)
Sets the symbology of BarCodeBuilder. Supported symbologies:
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()
Gets CaptionAbove of the barcode image. Evaluation version of aspose barcode will force an Aspose.Demo CaptionAbove
BarCodeBuilder b = new BarCodeBuilder(); b.getCaptionAbove().setText("This is the caption above");
setCaptionAbove(Caption)
,
Caption
,
setCaptionBelow(Caption)
,
getCaptionBelow()
public void setCaptionAbove(Caption value)
Sets the CaptionAbove of the barcode image. Evaluation version of aspose barcode will force an Aspose.Demo CaptionAbove
BarCodeBuilder b = new BarCodeBuilder(); b.setCaptionAbove(new Caption("this is a caption"));
value
- of com.aspose.barcode.CaptionCaption
,
getCaptionAbove()
,
getCaptionBelow()
,
setCaptionBelow(Caption)
public Caption getCaptionBelow()
Gets the caption below the barcode image
BarCodeBuilder b = new BarCodeBuilder(); b.getCaptionBelow().setVisible(false);
Caption
,
setCaptionBelow(Caption)
,
getCaptionAbove()
,
setCaptionAbove(Caption)
public void setCaptionBelow(Caption value)
Sets the caption below the barcode image
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()
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
setCodeText(String)
public 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. Some barcode symbologies may require certain types of code text, such as UPCA and UPCE require numbers only
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()
Gets the code text's font of a barcode. barcode image normally has human readable code text printed along with the machine readable barcode. Code text font specifies human readable code text's font style. Default font is Serif.
Font
,
setCodeTextFont(Font)
public void setCodeTextFont(java.awt.Font value)
Sets the code text's font of a barcode. barcode image normally has human readable code text printed along with the machine readable barcode. Code text font specifies human readable code text's font style. Default font is Serif.
BarCodeBuilder b = new BarCodeBuilder(); b.setCodeTextFont(new Font("Serif", Font.BOLD + Font.ITALIC, 20));
value
- of java.awt.FontFont
,
getCodeTextFont()
public boolean getBorderVisible()
Gets whether to draw the border or not
setBorderVisible(boolean)
,
getBorderColor()
,
getBorderWidth()
,
setBorderColor(Color)
,
setBorderWidth(float)
public void setBorderVisible(boolean value)
Sets whether to draw the border or not
value
- of booleangetBorderVisible()
,
getBorderColor()
,
getBorderWidth()
,
setBorderColor(Color)
,
setBorderWidth(float)
public float getBorderWidth()
Gets border's width of a barcode image. measured by GraphicsUnit, defaulted: millimeter
GraphicsUnit
,
getBorderColor()
,
setBorderColor(Color)
,
getBorderVisible()
,
setBorderVisible(boolean)
public void setBorderWidth(float value)
Sets border's width of a barcode image. measured by GraphicsUnit, defaulted: millimeter
value
- greater or equal to zeroGraphicsUnit
,
getBorderColor()
,
setBorderColor(Color)
,
getBorderVisible()
,
setBorderVisible(boolean)
public boolean getEnableChecksum()
Gets whether checksum is enabled. Some symbologies such as UPCA, UPCE require Checksum to be presented, they will ignore enable checksum setting
public void setEnableChecksum(boolean value)
Sets wether checksum is enabled. Some symbologies such as UPCA, UPCE require Checksum to be presented, they will ignore enable checksum setting
public Margins getMargins()
Gets the marginal size of an barcode image, the area around the barcode. If autosize option is set to true, marginal area will grow automatically if captions won't fit in
Margins
,
setMargins(Margins)
public void setMargins(Margins value)
Sets the marginal size of an barcode image, the area around the barcode. If autosize option is set to true, marginal area will grow automatically if captions won't fit in
getMargins()
,
Margins
public float getRotationAngle()
Gets the rotation angle of the barcode image defaults to 0 degree
public 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
value
- of float, rotation angleImageQuality
,
getRotationAngle()
public float getXDimension()
Gets the width of a smallest bar, or the smallest module's width of 2D barcodes measured in GraphicsUnit
GraphicsUnit
,
setXDimension(float)
public void setXDimension(float value)
Sets the width of a smallest bar, or the smallest module's width of 2D barcodes measured in GraphicsUnit
BarCodeBuilder b = new BarCodeBuilder(); b.setGraphicsUnit(GraphicsUnit.MILIMETER); b.setXDimension(0.5f);
value
- of float, xDimension values measured in com.aspose.barcode.GraphicsUnitpublic float getBarHeight()
Gets the bar's height for 1D barcodes, measured in com.aspose.barcode.GraphicsUnit
setBarHeight(float)
,
GraphicsUnit
public void setBarHeight(float value)
Sets the bar's height for 1D barcodes, measured in com.aspose.barcode.GraphicsUnit
BarCodeBuilder b = new BarCodeBuilder(); b.setGraphicsUnit(GraphicsUnit.MILIMETER); b.setBarHeight(20f);
value
- of float, bar's height of one dimensional barcodepublic int getGraphicsUnit()
Gets the measurement of graphics unit, default to millimeter
GraphicsUnit
public void setGraphicsUnit(int value)
Sets the measurement of graphics unit, default to millimeter
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()
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
setForeColor(Color)
public 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
value
- of Color, java.awt.ColorColor
,
setForeColor(Color)
public java.awt.Color getBackColor()
Gets the background color of the barcode image, default to white
Color
,
getForeColor()
public void setBackColor(java.awt.Color value)
Sets the background color of the barcode image, default to white
BarCodeBuilder b = new BarCodeBuilder(); b.setBackColor(Color.WHITE);
value
- of Color, java.awt.ColorColor
,
getBackColor()
public java.awt.Color getCodeTextColor()
Gets the human readable code text's color
setCodeTextColor(Color)
,
Color
public void setCodeTextColor(java.awt.Color value)
Sets the human readable code text's color
value
- of Color, java.awt.ColorsetCodeTextColor(Color)
public Resolution getResolution()
Gets the resolution of the barcode image
BarCodeBuilder b = new BarCodeBuilder(); b.getResolution().setDpiX(96); b.getResolution().setDpiY(96);
setResolution(Resolution)
,
Resolution
public void setResolution(Resolution value)
Sets the resolution of the barcode image
BarCodeBuilder b = new BarCodeBuilder(); b.setResolution(new Resolution(96, 96));
value
- of Resolution, com.aspose.barcode.ResolutionResolution
,
getResolution()
public boolean getCodeTextVisible()
Gets whether or not to show the human readable code text
setcodeTextVisible(boolean)
public void setcodeTextVisible(boolean value)
Sets whether or not to show the human readable code text, some symbologies of barcode may ignore this setting
getCodeTextVisible()
public 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
setImageQuality(int)
,
ImageQuality
public 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
BarCodeBuilder b = new BarCodeBuilder(); b.setImageQuality(ImageQuality.ANTI_ALIAS);
value
- of ImageQuality, com.aspose.barcode.ImageQualityImageQuality
public int getCodabarStartSymbol()
Gets the start symbol for codabar types of barcode
CodabarSymbol
public void setCodabarStartSymbol(int value)
Sets the start symbol for codabar types of barcode
BarCodeBuilder b = new BarCodeBuilder(); b.setCodabarStartSymbol(CodabarSymbol.A);
value
- of CodabarSymbol, com.aspose.barcode.CodabarSymbolCodabarSymbol
public int getCodabarStopSymbol()
Gets the stop symbol of codabar types of barcode
CodabarSymbol
,
setCodabarStopSymbol(int)
public void setCodabarStopSymbol(int value)
Sets the stop symbol of codabar types of barcode
BarCodeBuilder b = new BarCodeBuilder(); b.setCodabarStopSymbol(CodabarSymbol.A);
value
- of CodarbarSymbol, com.aspose.barcode.CodarbarSymbolCodabarSymbol
,
getCodabarStopSymbol()
public int getCode128Set()
Gets code set for code128 types of barcode
Code128Set
public void setCode128Set(int value)
Sets code set for code128 types of barcode
BarCodeBuilder b = new BarCodeBuilder(); b.setSymbology(Symbology.CODE128); b.setCode128Set(Code128Set.AUTO);
value
- of Code128Set, com.aspose.barcode.Code128SetCode128Set
public float getWideNarrowRatio()
Gets wide bars to narrow bars ratio for some types of one dimensional barcode
setWideNarrowRatio(float)
public void setWideNarrowRatio(float value)
Sets wide bars to narrow bars ratio for some types of one dimensional barcode, default to 3.0
getWideNarrowRatio()
public boolean getAutoSize()
Gets whether auto sizing the barcode image or not. If auto size set to false, image size will be decided by width and height settings
setWidth(float)
,
setHeight(float)
public void setAutoSize(boolean value)
Sets whether auto sizing the barcode image or not. If auto size set to false, image size will be decided by width and height settings
setWidth(float)
,
setHeight(float)
public float getWidth()
Gets the width of a barcode image.
setWidth(float)
public void setWidth(float value)
Sets the width of a barcode image, if auto size is set to true, Width and Height settings will be ignored
setAutoSize(boolean)
,
getWidth()
public float getHeight()
Gets the height of a barcode image.
setHeight(float)
public void setHeight(float value)
Sets the height of a barcode image, if auto size is set to true, Width and Height settings will be ignored
getHeight()
,
setAutoSize(boolean)
public java.awt.Color getBorderColor()
Gets border's color of the barcode image
setBorderColor(Color)
public void setBorderColor(java.awt.Color value)
Sets border's color of the barcode image
value
- of Color, java.awt.ColorColor
public void save(java.lang.String filename) throws java.io.IOException, BarCodeException
Saves the barcode image to file
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
Saves the barcode image to file
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
Saves the barcode image to file
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()
Returns an Image instance of the barcode image
public void render(java.awt.Graphics g)
Renders barcode by 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)
Renders barcode by Graphics2D g
g
- java.awt.Graphics2DGraphics2D
public void render(javax.servlet.http.HttpServletResponse response) throws java.io.IOException, javax.servlet.ServletException
Renders barcode to servlet
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
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |