com.aspose.barcode
Class BarCodeBuilder

java.lang.Object
  extended bycom.aspose.barcode.BarCodeBuilder

public final class BarCodeBuilder
extends java.lang.Object

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
 

Example

 		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();
 		}
 

Example

 	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 Aztec type of barcode
static long SYMBOLOGY_CODABAR
          Specifies Codabar type of barcode
static long SYMBOLOGY_CODE11
          Specifies Code11 type of barcode
static long SYMBOLOGY_CODE39EXTENDED
          Specifies Code39 Extended type of barcode
static long SYMBOLOGY_CODE39STANDARD
          Specifies Code39 Standard type of barcode
static long SYMBOLOGY_CODE93EXTENDED
          Specifies Code93 Extended type of barcode
static long SYMBOLOGY_CODE93STANDARD
          Specifies Code93 Standardtype of barcode
static long SYMBOLOGY_DATAMATRIX
          Specifes Datamatrix type of barcode
static long SYMBOLOGY_EAN128
          Specifes Ean128 type of barcode
static long SYMBOLOGY_EAN13
          Specifies EAN13 type of barcode
static long SYMBOLOGY_EAN14
          Specifies EAN14 type of barcode
static long SYMBOLOGY_EAN8
          Specifies EAN8 type of barcode
static long SYMBOLOGY_INTERLEAVED2OF5
          Specifies Interleaved 2 of 5 type of barcode
static long SYMBOLOGY_ITF14
          Specifes ITF14 type of barcode
static long SYMBOLOGY_MSI
          Specifies MSI type of barcode
static long SYMBOLOGY_ONECODE
          Specifies USPS OneCode type of barcode
static long SYMBOLOGY_PDF417
          Specifies PDF417 type of barcode
static long SYMBOLOGY_PLANET
          Specifies Planet type of barcode
static long SYMBOLOGY_POSTNET
          Specifies Postnet type of barcode
static long SYMBOLOGY_QR
          Specifies QR type of barcode
static long SYMBOLOGY_SSCC18
          Specifies SSCC18 type of barcode
static long SYMBOLOGY_STANDARD2OF5
          Specifies Standard 2 of 5 type of barcode
static long SYMBOLOGY_UPCA
          Specifies UPCA type of barcode
static long SYMBOLOGY_UPCE
          Specifies UPCE type of barcode
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

Example BarCodeBuilder b = new BarCodeBuilder(); b.getCaptionBelow().setVisible(false);

 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

Example

BarCodeBuilder b = new BarCodeBuilder(); b.getResolution().setDpiX(96); b.getResolution().setDpiY(96);

 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

Example

public class AppletSample extends Applet { public void paint(Graphics g) { BarCodeBuilder b = new BarCodeBuilder(); b.setSymbology(Symbology.CODE128); b.setCodeText("12345678"); b.render(g); } }

 void render(java.awt.Graphics2D g)
          

Renders barcode by Graphics2D g

 void render(javax.servlet.http.HttpServletResponse response)
          

Renders barcode to servlet

Example 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); } }

 void save(java.io.File file, java.lang.String imageFormat)
          

Saves the barcode image to file

Example BarCodeBuilder b = new BarCodeBuilder(); b.setSymbology(Symbology.CODE128); b.setCodeText("1234566"); //save as bmp b.save(new File("C:\\test.bmp"), "bmp");

 void save(java.lang.String filename)
          

Saves the barcode image to file

Example 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");

 void save(java.lang.String filename, java.lang.String imageFormat)
          

Saves the barcode image to file

Example 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");

 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

Example BarCodeBuilder b = new BarCodeBuilder(); b.setBackColor(Color.WHITE);

 void setBarHeight(float value)
          

Sets the bar's height for 1D barcodes, measured in com.aspose.barcode.GraphicsUnit

Example BarCodeBuilder b = new BarCodeBuilder(); b.setGraphicsUnit(GraphicsUnit.MILIMETER); b.setBarHeight(20f);

 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

Example BarCodeBuilder b = new BarCodeBuilder(); b.setCaptionBelow(new Caption("Caption below the barcode image"));

 void setCodabarStartSymbol(int value)
          

Sets the start symbol for codabar types of barcode

Example BarCodeBuilder b = new BarCodeBuilder(); b.setCodabarStartSymbol(CodabarSymbol.A);

 void setCodabarStopSymbol(int value)
          

Sets the stop symbol of codabar types of barcode

Example BarCodeBuilder b = new BarCodeBuilder(); b.setCodabarStopSymbol(CodabarSymbol.A);

 void setCode128Set(int value)
          

Sets code set for code128 types of barcode

Example BarCodeBuilder b = new BarCodeBuilder(); b.setSymbology(Symbology.CODE128); b.setCode128Set(Code128Set.AUTO);

 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

Example 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);

 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

Example BarCodeBuilder b = new BarCodeBuilder(); b.setImageQuality(ImageQuality.ANTI_ALIAS);

 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

Example

BarCodeBuilder b = new BarCodeBuilder(); b.setResolution(new Resolution(96, 96));

 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

Example

 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

Example BarCodeBuilder b = new BarCodeBuilder(); b.setGraphicsUnit(GraphicsUnit.MILIMETER); b.setXDimension(0.5f);

 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

SYMBOLOGY_CODABAR

public static final long SYMBOLOGY_CODABAR
Specifies Codabar type of barcode

See Also:
com.aspose.barcode.Symbology.CODABAR, Constant Field Values

SYMBOLOGY_CODE11

public static final long SYMBOLOGY_CODE11
Specifies Code11 type of barcode

See Also:
com.aspose.barcode.Symbology.CODE11, Constant Field Values

SYMBOLOGY_CODE39EXTENDED

public static final long SYMBOLOGY_CODE39EXTENDED
Specifies Code39 Extended type of barcode

See Also:
com.aspose.barcode.Symbology.CODE39EXTENDED, Constant Field Values

SYMBOLOGY_CODE39STANDARD

public static final long SYMBOLOGY_CODE39STANDARD
Specifies Code39 Standard type of barcode

See Also:
com.aspose.barcode.Symbology.CODE39STANDARD, Constant Field Values

SYMBOLOGY_CODE93EXTENDED

public static final long SYMBOLOGY_CODE93EXTENDED
Specifies Code93 Extended type of barcode

See Also:
com.aspose.barcode.Symbology.CODE93EXTENDED, Constant Field Values

SYMBOLOGY_CODE93STANDARD

public static final long SYMBOLOGY_CODE93STANDARD
Specifies Code93 Standardtype of barcode

See Also:
com.aspose.barcode.Symbology.CODE93STANDARD, Constant Field Values

SYMBOLOGY_EAN13

public static final long SYMBOLOGY_EAN13
Specifies EAN13 type of barcode

See Also:
com.aspose.barcode.Symbology.EAN13, Constant Field Values

SYMBOLOGY_EAN8

public static final long SYMBOLOGY_EAN8
Specifies EAN8 type of barcode

See Also:
com.aspose.barcode.Symbology.EAN8, Constant Field Values

SYMBOLOGY_INTERLEAVED2OF5

public static final long SYMBOLOGY_INTERLEAVED2OF5
Specifies Interleaved 2 of 5 type of barcode

See Also:
com.aspose.barcode.Symbology.INTERLEAVED2OF5, Constant Field Values

SYMBOLOGY_MSI

public static final long SYMBOLOGY_MSI
Specifies MSI type of barcode

See Also:
com.aspose.barcode.Symbology.MSI, Constant Field Values

SYMBOLOGY_STANDARD2OF5

public static final long SYMBOLOGY_STANDARD2OF5
Specifies Standard 2 of 5 type of barcode

See Also:
com.aspose.barcode.Symbology.STANDARD2OF5, Constant Field Values

SYMBOLOGY_UPCA

public static final long SYMBOLOGY_UPCA
Specifies UPCA type of barcode

See Also:
com.aspose.barcode.Symbology.UPCA, Constant Field Values

SYMBOLOGY_UPCE

public static final long SYMBOLOGY_UPCE
Specifies UPCE type of barcode

See Also:
com.aspose.barcode.Symbology.UPCE, Constant Field Values

SYMBOLOGY_EAN128

public static final long SYMBOLOGY_EAN128
Specifes Ean128 type of barcode

See Also:
com.aspose.barcode.Symbology.EAN128, Constant Field Values

SYMBOLOGY_PDF417

public static final long SYMBOLOGY_PDF417
Specifies PDF417 type of barcode

See Also:
com.aspose.barcode.Symbology.PDF417, Constant Field Values

SYMBOLOGY_DATAMATRIX

public static final long SYMBOLOGY_DATAMATRIX
Specifes Datamatrix type of barcode

See Also:
com.aspose.barcode.Symbology.DATAMATRIX, Constant Field Values

SYMBOLOGY_AZTEC

public static final long SYMBOLOGY_AZTEC
Specifies Aztec type of barcode

See Also:
com.aspose.barcode.Symbology.AZTEC, Constant Field Values

SYMBOLOGY_QR

public static final long SYMBOLOGY_QR
Specifies QR type of barcode

See Also:
com.aspose.barcode.Symbology.QR, Constant Field Values

SYMBOLOGY_ITF14

public static final long SYMBOLOGY_ITF14
Specifes ITF14 type of barcode

See Also:
com.aspose.barcode.Symbology.ITF14, Constant Field Values

SYMBOLOGY_EAN14

public static final long SYMBOLOGY_EAN14
Specifies EAN14 type of barcode

See Also:
com.aspose.barcode.Symbology.EAN14, Constant Field Values

SYMBOLOGY_SSCC18

public static final long SYMBOLOGY_SSCC18
Specifies SSCC18 type of barcode

See Also:
com.aspose.barcode.Symbology.SSCC18, Constant Field Values

SYMBOLOGY_PLANET

public static final long SYMBOLOGY_PLANET
Specifies Planet type of barcode

See Also:
com.aspose.barcode.Symbology.PLANET, Constant Field Values

SYMBOLOGY_POSTNET

public static final long SYMBOLOGY_POSTNET
Specifies Postnet type of barcode

See Also:
com.aspose.barcode.Symbology.POSTNET, Constant Field Values

SYMBOLOGY_ONECODE

public static final long SYMBOLOGY_ONECODE
Specifies USPS OneCode type of barcode

See Also:
com.aspose.barcode.Symbology.ONECODE, Constant Field Values

CODABARSYMBOL_A

public static final int CODABARSYMBOL_A
Specifies Codabar type of barcode's start symbol and stop symbol to be A

See Also:
com.aspose.barcode.CodabarSymbol.A, Constant Field Values

CODABARSYMBOL_B

public static final int CODABARSYMBOL_B
Specifies Codabar type of barcode's start symbol and stop symbol to be B

See Also:
com.aspose.barcode.CodabarSymbol.B, Constant Field Values

CODABARSYMBOL_C

public static final int CODABARSYMBOL_C
Specifies Codabar type of barcode's start symbol and stop symbol to be C

See Also:
com.aspose.barcode.CodabarSymbol.C, Constant Field Values

CODABARSYMBOL_D

public static final int CODABARSYMBOL_D
Specifies Codabar type of barcode's start symbol and stop symbol to be D

See Also:
com.aspose.barcode.CodabarSymbol.D, Constant Field Values

GRAPHICSUNIT_DISPLAY

public static final int GRAPHICSUNIT_DISPLAY
Specifies the unit of measure of the display device. Typically pixels for video displays, and 1/100 inch for printers.

See Also:
com.aspose.barcode.GraphicsUnit.DISPLAY, Constant Field Values

GRAPHICSUNIT_DOCUMENT

public static final int GRAPHICSUNIT_DOCUMENT
Specifies the document unit (1/300 inch) as the unit of measure.

See Also:
com.aspose.barcode.GraphicsUnit.DOCUMENT, Constant Field Values

GRAPHICSUNIT_INCH

public static final int GRAPHICSUNIT_INCH
Specifies the inch as the unit of measure

See Also:
com.aspose.barcode.GraphicsUnit.INCH, Constant Field Values

GRAPHICSUNIT_MILIMETER

public static final int GRAPHICSUNIT_MILIMETER
Specifies the milimeter as the unit of measure

See Also:
com.aspose.barcode.GraphicsUnit.MILIMETER, Constant Field Values

GRAPHICSUNIT_PIXEL

public static final int GRAPHICSUNIT_PIXEL
Specifies x device pixel as the unit of measure

See Also:
com.aspose.barcode.GraphicsUnit.PIXEL, Constant Field Values

GRAPHICSUNIT_POINT

public static final int GRAPHICSUNIT_POINT
Specifies x printer's point (1/72 inch) as the unit of measure

See Also:
com.aspose.barcode.GraphicsUnit.POINT, Constant Field Values

TEXTALIGN_CENTER

public static final int TEXTALIGN_CENTER
Specifies text should align to the center

See Also:
com.aspose.barcode.TextAlign.CENTER, Constant Field Values

TEXTALIGN_LEFT

public static final int TEXTALIGN_LEFT
Specifies text should align to the left

See Also:
com.aspose.barcode.TextAlign.LEFT, Constant Field Values

TEXTALIGN_RIGHT

public static final int TEXTALIGN_RIGHT
Specifies text should align to the right.

See Also:
com.aspose.barcode.TextAlign.RIGHT, Constant Field Values

IMAGEQUALITY_DEFAULT

public static final int IMAGEQUALITY_DEFAULT
Specifies image quality mode to be default

See Also:
com.aspose.barcode.ImageQuality.DEFAULT, Constant Field Values

IMAGEQUALITY_ANTIALIAS

public static final int IMAGEQUALITY_ANTIALIAS
Specifies image quality mode to be anti-alias

See Also:
com.aspose.barcode.ImageQuality.ANTI_ALIAS, Constant Field Values

ITF14BORDERTYPE_NONE

public static final int ITF14BORDERTYPE_NONE
Specifies ITF14 type of barcode without borders.

See Also:
com.aspose.barcode.ITF14BorderType.NONE, Constant Field Values

ITF14BORDERTYPE_FRAME

public static final int ITF14BORDERTYPE_FRAME
Specifies ITF14 type of barcode with framing borders.

See Also:
com.aspose.barcode.ITF14BorderType.FRAME, Constant Field Values

ITF14BORDERTYPE_BAR

public static final int ITF14BORDERTYPE_BAR
Specifies ITF14 type of barcode with two horizontal guarding bars

See Also:
com.aspose.barcode.ITF14BorderType.BAR, Constant Field Values

PDF417COMPACTMODE_AUTO

public static final int PDF417COMPACTMODE_AUTO
Specifies auto detect compaction mode for PDF417 type of barcode

See Also:
com.aspose.barcode.PDF417CompactMode.AUTO, Constant Field Values

PDF417COMPACTMODE_TEXT

public static final int PDF417COMPACTMODE_TEXT
Specifies text compaction mode for PDF417 type of barcode

See Also:
com.aspose.barcode.PDF417CompactMode.TEXT, Constant Field Values

PDF417COMPACTMODE_NUMERIC

public static final int PDF417COMPACTMODE_NUMERIC
Specifies numeric compaction mode for PDF417 type of barcode

See Also:
com.aspose.barcode.PDF417CompactMode.NUMERIC, Constant Field Values

PDF417COMPACTMODE_BINARY

public static final int PDF417COMPACTMODE_BINARY
Specifies binary compaction mode for PDF417 type of barcode

See Also:
com.aspose.barcode.PDF417CompactMode.BINARY, Constant Field Values

PDF417ERRORLEVEL_0

public static final int PDF417ERRORLEVEL_0
Specifies error correction level 0 for PDF417 type of barcode

See Also:
com.aspose.barcode.PDF417ErrorLevel.LEVEL0, Constant Field Values

PDF417ERRORLEVEL_1

public static final int PDF417ERRORLEVEL_1
Specifies error correction level 1 for PDF417 type of barcode

See Also:
com.aspose.barcode.PDF417ErrorLevel.LEVEL1, Constant Field Values

PDF417ERRORLEVEL_2

public static final int PDF417ERRORLEVEL_2
Specifies error correction level 2 for PDF417 type of barcode

See Also:
com.aspose.barcode.PDF417ErrorLevel.LEVEL2, Constant Field Values

PDF417ERRORLEVEL_3

public static final int PDF417ERRORLEVEL_3
Specifies error correction level 3 for PDF417 type of barcode

See Also:
com.aspose.barcode.PDF417ErrorLevel.LEVEL3, Constant Field Values

PDF417ERRORLEVEL_4

public static final int PDF417ERRORLEVEL_4
Specifies error correction level 4 for PDF417 type of barcode

See Also:
com.aspose.barcode.PDF417ErrorLevel.LEVEL4, Constant Field Values

PDF417ERRORLEVEL_5

public static final int PDF417ERRORLEVEL_5
Specifies error correction level 5 for PDF417 type of barcode

See Also:
com.aspose.barcode.PDF417ErrorLevel.LEVEL5, Constant Field Values

PDF417ERRORLEVEL_6

public static final int PDF417ERRORLEVEL_6
Specifies error correction level 6 for PDF417 type of barcode

See Also:
com.aspose.barcode.PDF417ErrorLevel.LEVEL6, Constant Field Values

PDF417ERRORLEVEL_7

public static final int PDF417ERRORLEVEL_7
Specifies error correction level 7 for PDF417 type of barcode

See Also:
com.aspose.barcode.PDF417ErrorLevel.LEVEL7, Constant Field Values

PDF417ERRORLEVEL_8

public static final int PDF417ERRORLEVEL_8
Specifies error correction level 8 ( highest level ) for PDF417 type of barcode

See Also:
com.aspose.barcode.PDF417ErrorLevel.LEVEL8, Constant Field Values

QRERRORLEVEL_L

public static final int QRERRORLEVEL_L
Specifies recovery of 7% of QR type of barcode

See Also:
com.aspose.barcode.QRErrorLevel.LEVEL_L, Constant Field Values

QRERRORLEVEL_M

public static final int QRERRORLEVEL_M
Specifies recovery of 15% of QR type of barcode

See Also:
com.aspose.barcode.QRErrorLevel.LEVEL_M, Constant Field Values

QRERRORLEVEL_Q

public static final int QRERRORLEVEL_Q
Specifies recovery of 25% of QR type of barcode

See Also:
com.aspose.barcode.QRErrorLevel.LEVEL_Q, Constant Field Values

QRERRORLEVEL_H

public static final int QRERRORLEVEL_H
Specifies recovery of 30% of QR type of barcode

See Also:
com.aspose.barcode.QRErrorLevel.LEVEL_H, Constant Field Values

DATAMATRIXMODE_AUTO

public static final int DATAMATRIXMODE_AUTO
Specifies automatically pick up the best encode mode for datamatrix type of barcode.

See Also:
com.aspose.barcode.DataMatrixMode.AUTO, Constant Field Values

DATAMATRIXMODE_ASCII

public static final int DATAMATRIXMODE_ASCII
Specifies encoding one alphanumeric or two numeric characters per byte for datamatrix type of barcode

See Also:
com.aspose.barcode.DataMatrixMode.ASCII, Constant Field Values

DATAMATRIXMODE_FULL

public static final int DATAMATRIXMODE_FULL
Specifies encoding 8 bit values for datamatrix type of barcode

See Also:
com.aspose.barcode.DataMatrixMode.FULL, Constant Field Values

AZTECERRORLEVEL_MIN

public static final int AZTECERRORLEVEL_MIN
Specifies minimun error correction for Aztec type of barcode

See Also:
com.aspose.barcode.AztecErrorLevel.MIN, Constant Field Values

AZTECERRORLEVEL_LOW

public static final int AZTECERRORLEVEL_LOW
Specifies low level error correction for Aztec type of barcode

See Also:
com.aspose.barcode.AztecErrorLevel.LOW, Constant Field Values

AZTECERRORLEVEL_MEDIUM

public static final int AZTECERRORLEVEL_MEDIUM
Specifies medium level error correction for Aztec type of barcode

See Also:
com.aspose.barcode.AztecErrorLevel.MEDIUM, Constant Field Values

AZTECERRORLEVEL_HIGH

public static final int AZTECERRORLEVEL_HIGH
Specifies high error correction for Aztec type of barcode

See Also:
com.aspose.barcode.AztecErrorLevel.HIGH, Constant Field Values

AZTECERRORLEVEL_MAX

public static final int AZTECERRORLEVEL_MAX
Specifies max error correction for Aztec type of barcode

See Also:
com.aspose.barcode.AztecErrorLevel.MAX, Constant Field Values
Constructor Detail

BarCodeBuilder

public BarCodeBuilder()
Constructs x BarCodeBuilder


BarCodeBuilder

public BarCodeBuilder(int symbology,
                      java.lang.String codeText)
Constructs x BarCodeBuilder with specific Symbology and CodeText

Parameters:
symbology - Symbology of barcode
codeText - Data to be encoded
See Also:
Symbology
Method Detail

getSymbology

public long getSymbology()

Gets the symbology of BarCodeBuilder. Supported Symbologies:

 Codabar, Code11, Code128, Code39, Code39 extended, Code93, Code93 extended
 Interleaved 2of5, Standard2of5, MSI, UPCA, UPCE
 
Example
 	BarCodeBuilder b = new BarCodeBuilder();
 	if(b.getSymbology() != Symbology.CODE128)
 	{
 		b.setSymbology(Symbology.CODE128)
 	}
 

See Also:
Symbology, setSymbology(long value)

setSymbology

public void setSymbology(long value)

Sets the symbology of BarCodeBuilder. Supported symbologies:

 Codabar, Code11, Code128, Code39, Code39 extended, Code93, Code93 extended
 Interleaved 2of5, Standard2of5, MSI, UPCA, UPCE
 

Parameters:
value - from com.aspose.barcode.Symbology

Example

                           	BarCodeBuilder b = new BarCodeBuilder();
                           	if(b.getSymbology() != Symbology.CODE128)
                           	{
                           		b.setSymbology(Symbology.CODE128)
                           	}
                           
See Also:
getSymbology(), Symbology

getCaptionAbove

public Caption getCaptionAbove()

Gets CaptionAbove of the barcode image. Evaluation version of aspose barcode will force an Aspose.Demo CaptionAbove

Example

 	BarCodeBuilder b = new BarCodeBuilder();
 	b.getCaptionAbove().setText("This is the caption above");
 

Returns:
com.aspose.barcode.Caption
See Also:
setCaptionAbove(Caption), Caption, setCaptionBelow(Caption), getCaptionBelow()

setCaptionAbove

public void setCaptionAbove(Caption value)

Sets the CaptionAbove of the barcode image. Evaluation version of aspose barcode will force an Aspose.Demo CaptionAbove

Example

 	BarCodeBuilder b = new BarCodeBuilder();
 	b.setCaptionAbove(new Caption("this is x caption"));
 

Parameters:
value - of com.aspose.barcode.Caption
See Also:
Caption, getCaptionAbove(), getCaptionBelow(), setCaptionBelow(Caption)

getCaptionBelow

public Caption getCaptionBelow()

Gets the caption below the barcode image

Example

 	BarCodeBuilder b = new BarCodeBuilder();
 	b.getCaptionBelow().setVisible(false);
 

Returns:
com.aspose.barcode.Caption
See Also:
Caption, setCaptionBelow(Caption), getCaptionAbove(), setCaptionAbove(Caption)

setCaptionBelow

public void setCaptionBelow(Caption value)

Sets the caption below the barcode image

Example

 	BarCodeBuilder b = new BarCodeBuilder();
 	b.setCaptionBelow(new Caption("Caption below the barcode image"));
 

Parameters:
value - of com.aspose.barcode.Caption
See Also:
getCaptionBelow(), setCaptionAbove(Caption), getCaptionAbove(), Caption

getCodeText

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

Returns:
String
See Also:
setCodeText(String)

setCodeText

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

Example

 	BarCodeBuilder b = new BarCodeBuilder();
 	b.setCodeText("12345678");
 	b.setSymbology(Symbology.UPCA);
 	try
 	{
 		b.save("test.jpg");
 	}
 	catch(Exception ex)
 	{
 		ex.printStackTrace();
 	}
 

Parameters:
value - of String
See Also:
getCodeText()

getCodeTextFont

public 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. Code text font specifies human readable code text's font style. Default font is Serif.

Returns:
java.awt.Font
See Also:
Font, setCodeTextFont(Font)

setCodeTextFont

public 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. Code text font specifies human readable code text's font style. Default font is Serif.

Example

 	BarCodeBuilder b = new BarCodeBuilder();
 	b.setCodeTextFont(new Font("Serif", Font.BOLD + Font.ITALIC, 20));
 

Parameters:
value - of java.awt.Font
See Also:
Font, getCodeTextFont()

getBorderVisible

public boolean getBorderVisible()

Gets whether to draw the border or not

Returns:
boolean
See Also:
setBorderVisible(boolean), getBorderColor(), getBorderWidth(), setBorderColor(Color), setBorderWidth(float)

setBorderVisible

public void setBorderVisible(boolean value)

Sets whether to draw the border or not

Parameters:
value - of boolean
See Also:
getBorderVisible(), getBorderColor(), getBorderWidth(), setBorderColor(Color), setBorderWidth(float)

getBorderWidth

public float getBorderWidth()

Gets border's width of x barcode image. measured by GraphicsUnit, defaulted: millimeter

Returns:
border's width if visible
See Also:
GraphicsUnit, getBorderColor(), setBorderColor(Color), getBorderVisible(), setBorderVisible(boolean)

setBorderWidth

public void setBorderWidth(float value)

Sets border's width of x barcode image. measured by GraphicsUnit, defaulted: millimeter

Parameters:
value - greater or equal to zero
See Also:
GraphicsUnit, getBorderColor(), setBorderColor(Color), getBorderVisible(), setBorderVisible(boolean)

getEnableChecksum

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


setEnableChecksum

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


getMargins

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

BarCodeBuilder b = new BarCodeBuilder(); b.setGraphicsUnit(GraphicsUnit.MILIMETER); //10 millimeters marginal area at the bottom and the left b.getMargins().setBottom(10); b.getMargins().setLeft(10);

Returns:
Current margin settings
See Also:
Margins, setMargins(Margins)

setMargins

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

BarCodeBuilder b = new BarCodeBuilder(); b.setMargins(new Margins(10, 10, 10, 10));

See Also:
getMargins(), Margins

getRotationAngle

public float getRotationAngle()

Gets the rotation angle of the barcode image defaults to 0 degree

Returns:
rotation angle

setRotationAngle

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

Example

BarCodeBuilder b = new BarCodeBuilder(); b.setImageQuality(ImageQuality.ANTI_ALIAS); //setting up rotation angle to 45 degree b.setRotationAngle(45);

Parameters:
value - of float, rotation angle
See Also:
ImageQuality, getRotationAngle()

getXDimension

public float getXDimension()

Gets the width of x smallest bar, or the smallest module's width of 2D barcodes measured in GraphicsUnit

See Also:
GraphicsUnit, setXDimension(float)

setXDimension

public void setXDimension(float value)

Sets the width of x smallest bar, or the smallest module's width of 2D barcodes measured in GraphicsUnit

Example

 	BarCodeBuilder b = new BarCodeBuilder();
 	b.setGraphicsUnit(GraphicsUnit.MILIMETER);
 	b.setXDimension(0.5f);
 

Parameters:
value - of float, xDimension values measured in com.aspose.barcode.GraphicsUnit

getYDimension

public float getYDimension()

Gets the height of x smallest module of 2D barcodes.

Returns:
float

setYDimension

public void setYDimension(float value)

Sets the height of x smallest module of 2D barcodes.

Parameters:
value - of float

getBarHeight

public float getBarHeight()

Gets the bar's height for 1D barcodes, measured in com.aspose.barcode.GraphicsUnit

Returns:
bar's height of one dimensional barcode
See Also:
setBarHeight(float), GraphicsUnit

setBarHeight

public void setBarHeight(float value)

Sets the bar's height for 1D barcodes, measured in com.aspose.barcode.GraphicsUnit

Example

 	BarCodeBuilder b = new BarCodeBuilder();
 	b.setGraphicsUnit(GraphicsUnit.MILIMETER);
 	b.setBarHeight(20f);
 

Parameters:
value - of float, bar's height of one dimensional barcode

getGraphicsUnit

public int getGraphicsUnit()

Gets the measurement of graphics unit, default to millimeter

Returns:
com.aspose.barcode.GraphicsUnit
See Also:
GraphicsUnit

setGraphicsUnit

public void setGraphicsUnit(int value)

Sets the measurement of graphics unit, default to millimeter

Example

 	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);
 

Parameters:
value - of int, com.aspose.barcode.GraphicsUnit
See Also:
GraphicsUnit

getForeColor

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

Returns:
java.awt.Color
See Also:
setForeColor(Color)

setForeColor

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

Parameters:
value - of Color, java.awt.Color
See Also:
Color, setForeColor(Color)

getBackColor

public java.awt.Color getBackColor()

Gets the background color of the barcode image, default to white

Returns:
java.awt.Color
See Also:
Color, getForeColor()

setBackColor

public void setBackColor(java.awt.Color value)

Sets the background color of the barcode image, default to white

Example

 	BarCodeBuilder b = new BarCodeBuilder();
 	b.setBackColor(Color.WHITE);
 

Parameters:
value - of Color, java.awt.Color
See Also:
Color, getBackColor()

getCodeTextColor

public java.awt.Color getCodeTextColor()

Gets the human readable code text's color

Returns:
java.awt.Color
See Also:
setCodeTextColor(Color), Color

setCodeTextColor

public void setCodeTextColor(java.awt.Color value)

Sets the human readable code text's color

Parameters:
value - of Color, java.awt.Color
See Also:
setCodeTextColor(Color)

getResolution

public Resolution getResolution()

Gets the resolution of the barcode image

Example

 	BarCodeBuilder b = new BarCodeBuilder();
 	b.getResolution().setDpiX(96);
 	b.getResolution().setDpiY(96);
 

Returns:
com.aspose.barcode.Resolution
See Also:
setResolution(Resolution), Resolution

setResolution

public void setResolution(Resolution value)

Sets the resolution of the barcode image

Example

 	BarCodeBuilder b = new BarCodeBuilder();
 	b.setResolution(new Resolution(96, 96));
 

Parameters:
value - of Resolution, com.aspose.barcode.Resolution
See Also:
Resolution, getResolution()

getCodeTextVisible

public boolean getCodeTextVisible()

Gets whether or not to show the human readable code text

See Also:
setCodeTextVisible(boolean)

setCodeTextVisible

public void setCodeTextVisible(boolean value)

Sets whether or not to show the human readable code text, some symbologies of barcode may ignore this setting

See Also:
getCodeTextVisible()

getImageQuality

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

Returns:
com.aspose.barcode.ImageQuality
See Also:
setImageQuality(int), ImageQuality

setImageQuality

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

Example

 	BarCodeBuilder b = new BarCodeBuilder();
 	b.setImageQuality(ImageQuality.ANTI_ALIAS);
 

Parameters:
value - of ImageQuality, com.aspose.barcode.ImageQuality
See Also:
ImageQuality

getCodabarStartSymbol

public int getCodabarStartSymbol()

Gets the start symbol for codabar types of barcode

Returns:
com.aspose.barcode.CodabarSymbol
See Also:
CodabarSymbol

setCodabarStartSymbol

public void setCodabarStartSymbol(int value)

Sets the start symbol for codabar types of barcode

Example

 	BarCodeBuilder b = new BarCodeBuilder();
 	b.setCodabarStartSymbol(CodabarSymbol.A);
 

Parameters:
value - of CodabarSymbol, com.aspose.barcode.CodabarSymbol
See Also:
CodabarSymbol

getCodabarStopSymbol

public int getCodabarStopSymbol()

Gets the stop symbol of codabar types of barcode

Returns:
com.aspose.barcode.CodabarSymbol
See Also:
CodabarSymbol, setCodabarStopSymbol(int)

setCodabarStopSymbol

public void setCodabarStopSymbol(int value)

Sets the stop symbol of codabar types of barcode

Example

 	BarCodeBuilder b = new BarCodeBuilder();
 	b.setCodabarStopSymbol(CodabarSymbol.A);
 

Parameters:
value - of CodarbarSymbol, com.aspose.barcode.CodarbarSymbol
See Also:
CodabarSymbol, getCodabarStopSymbol()

getCode128Set

public int getCode128Set()

Gets code set for code128 types of barcode

Returns:
com.aspose.barcode.Code128Set
See Also:
Code128Set

setCode128Set

public void setCode128Set(int value)

Sets code set for code128 types of barcode

Example

 	BarCodeBuilder b = new BarCodeBuilder();
 	b.setSymbology(Symbology.CODE128);
 	b.setCode128Set(Code128Set.AUTO);
 

Parameters:
value - of Code128Set, com.aspose.barcode.Code128Set
See Also:
Code128Set

getWideNarrowRatio

public float getWideNarrowRatio()

Gets wide bars to narrow bars ratio for some types of one dimensional barcode

See Also:
setWideNarrowRatio(float)

setWideNarrowRatio

public void setWideNarrowRatio(float value)

Sets wide bars to narrow bars ratio for some types of one dimensional barcode, default to 3.0

See Also:
getWideNarrowRatio()

getAutoSize

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

See Also:
setWidth(float), setHeight(float)

setAutoSize

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

See Also:
setWidth(float), setHeight(float)

getWidth

public float getWidth()

Gets the width of x barcode image.

See Also:
setWidth(float)

setWidth

public 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

See Also:
setAutoSize(boolean), getWidth()

getHeight

public float getHeight()

Gets the height of x barcode image.

See Also:
setHeight(float)

setHeight

public 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

See Also:
getHeight(), setAutoSize(boolean)

getBorderColor

public java.awt.Color getBorderColor()

Gets border's color of the barcode image

Returns:
java.awt.Color
See Also:
setBorderColor(Color)

setBorderColor

public void setBorderColor(java.awt.Color value)

Sets border's color of the barcode image

Parameters:
value - of Color, java.awt.Color
See Also:
Color

getITF14BorderType

public int getITF14BorderType()

Gets ITF14 barcode's border type

Returns:
ITF14BorderType
See Also:
ITF14BorderType

setITF14BorderType

public void setITF14BorderType(int value)

Sets ITF14 barcode's border type

Parameters:
value - of ITF14BorderType
See Also:
ITF14BorderType

getPDF417ErrorLevel

public int getPDF417ErrorLevel()

Gets error correction level of PDF417 barcode, from LEVEL0 to LEVEL8, LEVEL 0 for no error correction, LEVEL8 for max error correction.

Returns:
int
See Also:
PDF417ErrorLevel

setPDF417ErrorLevel

public 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.

Parameters:
value -
See Also:
PDF417ErrorLevel

getPDF417CompactMode

public int getPDF417CompactMode()

Gets compaction mode of PDF417 barcode, available modes are PDF417CompactMode.AUTO, PDF417CompactMode.BINARY, PDF417CompactMode.NUMERIC, PDF417CompactMode.TEXT

Returns:
int
See Also:
PDF417CompactMode

setPDF417CompactMode

public void setPDF417CompactMode(int value)
Sets compaction mode of PDF417 barcode, available modes are PDF417CompactMode.AUTO, PDF417CompactMode.BINARY, PDF417CompactMode.NUMERIC, PDF417CompactMode.TEXT

Parameters:
value - of int
See Also:
PDF417CompactMode

getPDF417Rows

public int getPDF417Rows()
Gets rows of PDF417 barcode, illegal settings will be ignored

Returns:
int

setPDF417Rows

public void setPDF417Rows(int value)
Sets rows of PDF417 barcode, illegal settings will be ignored

Parameters:
value -

getPDF417Columns

public int getPDF417Columns()
Gets columns of PDF417 barcode, illegal settings will be ignored

Returns:
columns of PDF417 type of barcode

setPDF417Columns

public void setPDF417Columns(int value)
Sets columns of PDF417 barcode, illegal settings will be ignored

Parameters:
value -

getPDF417Truncated

public boolean getPDF417Truncated()
Gets whether PDF417 barcode is truncated, that is, the right guard area om

Returns:
boolean

setPDF417Truncated

public void setPDF417Truncated(boolean value)
Sets whether PDF417 barcode is truncated.

Parameters:
value - of boolean

getPDF417AspectRatio

public float getPDF417AspectRatio()
Gets PDF417 barcode's module height to width ratio

Returns:
float
See Also:
setPDF417AspectRatio(float)

setPDF417AspectRatio

public void setPDF417AspectRatio(float value)
Sets PDF417 barcode's module height to width ratio

Parameters:
value - of float
See Also:
getPDF417AspectRatio()

getQRErrorLevel

public int getQRErrorLevel()
Gets QR barcode's error correction level.

Returns:
int
See Also:
QRErrorLevel, setQRErrorLevel(int)

setQRErrorLevel

public void setQRErrorLevel(int value)
Sets QR barcode's error correction level.

Parameters:
value - of int
See Also:
QRErrorLevel, getQRErrorLevel()

getDataMatrixMode

public int getDataMatrixMode()
Gets Datamatrix barcode's encode mode.

Returns:
int
See Also:
DataMatrixMode, setDataMatrixMode(int)

setDataMatrixMode

public void setDataMatrixMode(int value)
Sets Datamatrix barcode's encode mode

Parameters:
value -
See Also:
DataMatrixMode, getDataMatrixMode()

getAztecErrorLevel

public int getAztecErrorLevel()
Gets Aztec barcode's error correction level

Returns:
AztecErrorLevel
See Also:
setAztecErrorLevel(int), AztecErrorLevel

setAztecErrorLevel

public void setAztecErrorLevel(int value)
Sets Aztec barcode's error correction level

Parameters:
value - of int
See Also:
getAztecErrorLevel(), AztecErrorLevel

getPlanetShortBarHeight

public float getPlanetShortBarHeight()
Gets the short bar's height of Planet type of barcode, to set up tall bar's height, use setBarHeight and getBarHeight.

Returns:
Short bar height of Planet type of barcode.
See Also:
setPlanetShortBarHeight(float), setBarHeight(float)

setPlanetShortBarHeight

public 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. Illegal setting will be ignored.

Parameters:
value -
See Also:
getPlanetShortBarHeight(), setBarHeight(float)

getPostnetShortBarHeight

public float getPostnetShortBarHeight()
Gets the short bar's height of Postnet type of barcode, to set up tall bar's height, use setBarHeight and getBarHeight.

Returns:
Short bar height of Postnet type of barcode.
See Also:
setPostnetShortBarHeight(float)

setPostnetShortBarHeight

public 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. Illegal setting will be ignored.

Parameters:
value -
See Also:
getPostnetShortBarHeight()

getSupplementSpace

public float getSupplementSpace()
Gets the space between main barcode and the supplement barcode

Returns:
float
See Also:
setSupplementSpace(float)

setSupplementSpace

public void setSupplementSpace(float value)
Sets the space between main barcode and the supplement barcode

Parameters:
value -
See Also:
getSupplementSpace()

getSupplementText

public java.lang.String getSupplementText()
Gets the supplement barcode's code text. Only EAN8, EAN13, BooklandEAN, UPCA, UPCE has supplements. Supplement codetext only contains numeric characters with length to be 2 or 5.

Returns:
String

setSupplementText

public void setSupplementText(java.lang.String value)
Sets the supplement barcode's code text. Only EAN8, EAN13, BooklandEAN, UPCA, UPCE has supplements. Supplement codetext only contains numeric characters with length to be 2 or 5.

Example // Instantiate barcode object BarCodeBuilder bb = new BarCodeBuilder(); // Set up barcode symbology bb.setSymbology(Symbology.EAN13); // Set up supplement code text bb.setSupplementText("012345"); // Set up code text (data to encode) bb.setCodeText("1234567890");

Parameters:
value -

getMacroPDF417SegmentID

public int getMacroPDF417SegmentID()
Gets macro pdf417 barcode's segment ID, which starts from 0, to MacroPdf417SegmentCount - 1.

Returns:
int represents macro pdf417 barcode's segment ID

setMacroPDF417SegmentID

public void setMacroPDF417SegmentID(int macroPDF417SegmentID)
Sets macro pdf417 barcode's segment ID, which starts from 0, to MacroPdf417SegmentCount - 1.

Parameters:
macroPDF417SegmentID -

getMacroPDF417FileID

public int getMacroPDF417FileID()
Gets macro pdf417 barcode's file ID.

Returns:
int value represents macro pdf417 barcode's file ID.

setMacroPDF417FileID

public void setMacroPDF417FileID(int macroPDF417FileID)
Sets macro pdf417 barcode's file ID.

Parameters:
macroPDF417FileID -

getMacroPDF417LastSegment

public boolean getMacroPDF417LastSegment()
Gets whether this macro pdf417 barcode is the last segment.

Returns:
boolean value

setMacroPDF417LastSegment

public void setMacroPDF417LastSegment(boolean isMacroPDF417LastSegment)
Getswhether this macro pdf417 barcode is the last segment.

Parameters:
isMacroPDF417LastSegment -

save

public void save(java.lang.String filename)
          throws java.io.IOException,
                 BarCodeException

Saves the barcode image to file

Example

 	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");
 

Parameters:
filename - of String, full path of the image including file extension
Throws:
java.io.IOException
BarCodeException

getSupportedImageFormats

public java.lang.String[] getSupportedImageFormats()
Gets supporting image format (suffixes) by Save method

Returns:
formats String[]
See Also:
save(File,String), save(String,String)

save

public void save(java.lang.String filename,
                 java.lang.String imageFormat)
          throws java.io.IOException,
                 BarCodeException

Saves the barcode image to file

Example

 	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");
 

Parameters:
filename - full path of image to be saved
imageFormat - image format such as "bmp", "jpg", "jpeg"
Throws:
java.io.IOException
BarCodeException
See Also:
getSupportedImageFormats()

save

public void save(java.io.File file,
                 java.lang.String imageFormat)
          throws java.io.IOException,
                 BarCodeException

Saves the barcode image to file

Example

 	BarCodeBuilder b = new BarCodeBuilder();
 	b.setSymbology(Symbology.CODE128);
 	b.setCodeText("1234566");
 	//save as bmp
 	b.save(new File("C:\\test.bmp"), "bmp");
 

Parameters:
file - target file
imageFormat - image format such as "bmp", "jpg", "jpeg"
Throws:
java.io.IOException
BarCodeException

generateBarCodeImage

public java.awt.Image generateBarCodeImage()

Returns an Image instance of the barcode image

Returns:
Image instance

render

public void render(java.awt.Graphics g)

Renders barcode by Graphics g

Example

 

public class AppletSample extends Applet { public void paint(Graphics g) { BarCodeBuilder b = new BarCodeBuilder(); b.setSymbology(Symbology.CODE128); b.setCodeText("12345678"); b.render(g); } }

Parameters:
g - java.awt.Graphics
See Also:
Graphics

render

public void render(java.awt.Graphics2D g)

Renders barcode by Graphics2D g

Parameters:
g - java.awt.Graphics2D
See Also:
Graphics2D

render

public void render(javax.servlet.http.HttpServletResponse response)
            throws java.io.IOException,
                   javax.servlet.ServletException

Renders barcode to servlet

Example

 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); } }

Parameters:
response - HttpServletResponse
Throws:
java.io.IOException
javax.servlet.ServletException
See Also:
HttpServletResponse

getAustraliaPostFormatControlCode

public int getAustraliaPostFormatControlCode()

setAustraliaPostFormatControlCode

public void setAustraliaPostFormatControlCode(int australiaPostFormatControlCode)