com.aspose.barcode
Class BarCodeBuilder

java.lang.Object
  extended by com.aspose.barcode.BarCodeBuilder
All Implemented Interfaces:
IBarCodeControl

public class BarCodeBuilder
extends Object
implements IBarCodeControl

supported symbology: 1D: Codabar, Code11, Code128, Code39Standard, Code39Extended Code93Standard, Code93Extended, EAN13, EAN8, Interleaved2of5, MSI, Standard2of5, UPCA, UPCE, BooklandEAN, EAN128, Postnet, Planet EAN14(SCC14), SSCC18, ITF14, SingaporePost 2D: DataMatrix, PDf417, QR code Create and save a BarCode image BarCodeBuilder bd = new BarCodeBuilder(expStr, symbology); bd.setSymbologyType(symbology); bd.setCodeLocation(CodeLocation.ABOVE); bd.save(file);


Field Summary
static char EAN_128_FNC_1
           
 
Constructor Summary
BarCodeBuilder()
           BarCodeBuilder's constructer, default SymbologyType is Code128, default CodeText is 12345678
BarCodeBuilder(String CodeText)
           BarCodeBuilder's constructer, default SymbologyType is Code128
BarCodeBuilder(String CodeText, int type)
           BarCodeBuilder's constructer
 
Method Summary
 BufferedImage generateBarCodeImage()
           Generate the BarCode image under current settings
 float getAspectRatio()
           
 int getAustralianPosteParcelCodeSet()
           
 int getAustraliaPostFormatControlCode()
           
 boolean getAutoSize()
           
 int getAztectErrorLevel()
           Level of error corection of Aztect types of barcode. value should between 10 to 95
 Color getBackColor()
           
 BufferedImage getBarCodeImage()
           
 float getBarHeight()
           
 Color getBorderColor()
           
 int getBorderDashStyle()
           
 boolean getBorderVisible()
           
 float getBorderWidth()
           
 Caption getCaptionAbove()
           
 Caption getCaptionBelow()
           
 short getCodabarStartSymbol()
           
 short getCodabarStopSymbol()
           
 int getCode128CodeSet()
           
 int getCodeLocation()
          Specify the displaying CodeText's Location, set to CodeLocation.None to hide CodeText.
 String getCodeText()
           
 int getCodeTextAlignment()
           
 Color getCodeTextAwtColor()
          Gets CodeText's Color
 Font getCodeTextAwtFont()
          Specify the displaying CodeText's font
 float getCodeTextSpace()
           
 int getColumns()
           
 int getDataMatrixEncodeMode()
           
 int getEAN128EncodeMode()
           
 boolean getEnableChecksum()
           
 boolean getEnableEscape()
           
 Color getForeAwtColor()
           
 int getGraphicsUnit()
           
 float getImageHeight()
           
 int getImageQuality()
           
 int getImageUnit()
          Deprecated. 
 float getImageWidth()
           
 int getITF14BorderType()
           
 int getMacroPdf417FileID()
           
 boolean getMacroPdf417LastSegment()
           
 int getMacroPdf417SegmentID()
           
 MarginsF getMargins()
           
 int getPdf417CompactionMode()
           
 int getPdf417ErrorLevel()
           
 boolean getPdf417Truncate()
           
 float getPlanetShortBarHeight()
           
 float getPostnetShortBarHeight()
           
 String getPrinterName()
           
 int getQREncodeMode()
           QR symbology type of BarCode's encoding mode, default mode is Auto
 int getQRErrorLevel()
           Level of Reed-Solomon error correction for QR barcode.
 Resolution getResolution()
           
 int getRotationAngle()
          Deprecated. 
 float getRotationAngleF()
           BarCode image's rotation angle, measured in degree, e.g.
 int getRows()
           
 String getSupplementData()
           
 float getSupplementSpace()
           
 int getSymbologyType()
           
 int getTextRenderingHint()
           
 float getWideNarrowRatio()
           
 float getxDimension()
           
 float getyDimension()
           
 void rotate()
           Rotate barcode image clockwise for 90 degrees
 void rotate(float angle)
           Rotate barcode image clockwise
 void rotate(int angle)
           Rotate the barcode image
 void rotate(int direction, float angle)
           Rotate the barcode image
 void rotate(int direction, int angle)
           Rotate the barcode image
 void save(InputStream stream, com.aspose.barcode.ImageFormat format)
           
 void save(InputStream stream, int format)
           
 void save(OutputStream stream, int format)
           
 void save(String filename)
           Save BarCodeImage to specific file in specific format
 void save(String filename, com.aspose.barcode.ImageFormat format)
          Save BarCodeImage to specific file in specific format
 void save(String filename, int format)
          Save BarCodeImage to specific file in specific format
 void saveImageAs(InputStream stream, com.aspose.barcode.ImageFormat format)
           
 void saveImageAs(String filename)
           Save the barcode image
 void saveImageAs(String filename, com.aspose.barcode.ImageFormat format)
          Deprecated. 
 void setAlwaysShowChecksum(boolean value)
           
 void setAspectRatio(float value)
           
 void setAustralianPosteParcelCodeSet(int value)
           
 void setAustraliaPostFormatControlCode(int value)
           
 void setAutoSize(boolean value)
           
 void setAztectErrorLevel(int value)
           
 void setBackColor(Color value)
           
 void setBackColorInternal(Color value)
           
 void setBarHeight(float value)
           
 void setBorderColor(Color value)
           
 void setBorderDashStyle(int value)
           
 void setBorderVisible(boolean value)
           
 void setBorderWidth(float value)
           
 void setCaptionAbove(Caption value)
           
 void setCaptionBelow(Caption value)
           
 void setCodabarStartSymbol(short value)
           
 void setCodabarStopSymbol(short value)
           
 void setCode128CodeSet(int value)
           
 void setCodeLocation(int value)
          Specify the displaying CodeText's Location, set to CodeLocation.None to hide CodeText.
 void setCodeText(byte[] codeText)
          Set the data to be encoded.
 void setCodeText(String value)
           
 void setCodeTextAlignment(int value)
           
 void setCodeTextColor(Color color)
          Specify the displaying CodeText's Color
 void setCodeTextFont(Font value)
          Specify the displaying CodeText's font
 void setCodeTextSpace(float value)
           
 void setColumns(int value)
           
 void setDataMatrixEncodeMode(int value)
           
 void setEAN128EncodeMode(int value)
           
 void setEnableChecksum(boolean value)
           
 void setEnableEscape(boolean value)
           
 void setForeColor(Color value)
           
 void setGraphicsUnit(int value)
           
 void setImageHeight(float value)
           
 void setImageQuality(int value)
           
 void setImageUnit(int value)
          Deprecated. 
 void setImageWidth(float value)
           
 void setITF14BorderType(int value)
           
 void setMacroPdf417FileID(int value)
           
 void setMacroPdf417LastSegment(boolean value)
           
 void setMacroPdf417SegmentID(int value)
           
 void setMargins(MarginsF value)
           
 void setPdf417CompactionMode(int value)
           
 void setPdf417ErrorLevel(int value)
           
 void setPdf417Truncate(boolean value)
           
 void setPlanetShortBarHeight(float value)
           
 void setPostnetShortBarHeight(float value)
           
 void setPrinterName(String value)
           
 void setQREncodeMode(int value)
           
 void setQRErrorLevel(int value)
           
 void setResolution(Resolution value)
           
 void setRotationAngleF(float value)
           
 void setRows(int value)
           
 void setSupplementData(String value)
           
 void setSupplementSpace(float value)
           
 void setSymbologyType(int value)
           
 void setTextRenderingHint(int value)
           
 void setWideNarrowRatio(float value)
           
 void setxDimension(float value)
           
 void setYDimension(float value)
           
 String toString()
           overried to string method
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

EAN_128_FNC_1

public static final char EAN_128_FNC_1
See Also:
Constant Field Values
Constructor Detail

BarCodeBuilder

public BarCodeBuilder()

BarCodeBuilder's constructer, default SymbologyType is Code128, default CodeText is 12345678


BarCodeBuilder

public BarCodeBuilder(String CodeText)

BarCodeBuilder's constructer, default SymbologyType is Code128

Parameters:
CodeText - string text data to be encoded

BarCodeBuilder

public BarCodeBuilder(String CodeText,
                      int type)

BarCodeBuilder's constructer

Parameters:
CodeText - string text data to be encoded
type - BarCode's type: Aspose.BarCode.SymbologyType
Method Detail

getSymbologyType

public int getSymbologyType()
Specified by:
getSymbologyType in interface IBarCodeControl

setSymbologyType

public void setSymbologyType(int value)
Specified by:
setSymbologyType in interface IBarCodeControl

getCodeText

public String getCodeText()
Specified by:
getCodeText in interface IBarCodeControl

setCodeText

public void setCodeText(String value)
Specified by:
setCodeText in interface IBarCodeControl

setCodeText

public void setCodeText(byte[] codeText)
Set the data to be encoded.

Parameters:
codeText - The data to be encoded.

getEnableEscape

public boolean getEnableEscape()
Specified by:
getEnableEscape in interface IBarCodeControl

setEnableEscape

public void setEnableEscape(boolean value)
Specified by:
setEnableEscape in interface IBarCodeControl

getCodeTextAwtFont

public Font getCodeTextAwtFont()
Specify the displaying CodeText's font

Specified by:
getCodeTextAwtFont in interface IBarCodeControl

setCodeTextFont

public void setCodeTextFont(Font value)
Specify the displaying CodeText's font

Specified by:
setCodeTextFont in interface IBarCodeControl

getCodeTextAwtColor

public Color getCodeTextAwtColor()
Gets CodeText's Color

Specified by:
getCodeTextAwtColor in interface IBarCodeControl

setCodeTextColor

public void setCodeTextColor(Color color)
Specify the displaying CodeText's Color

Specified by:
setCodeTextColor in interface IBarCodeControl

getCodeLocation

public int getCodeLocation()
Specify the displaying CodeText's Location, set to CodeLocation.None to hide CodeText. CodeLocation will be ignored if SymbologyType is UPCE, UPCA, BooklandEAN, EAN8 or EAN13

Specified by:
getCodeLocation in interface IBarCodeControl

setCodeLocation

public void setCodeLocation(int value)
Specify the displaying CodeText's Location, set to CodeLocation.None to hide CodeText. CodeLocation will be ignored if SymbologyType is UPCE, UPCA, BooklandEAN, EAN8 or EAN13

Specified by:
setCodeLocation in interface IBarCodeControl

getCodeTextAlignment

public int getCodeTextAlignment()
Specified by:
getCodeTextAlignment in interface IBarCodeControl

setCodeTextAlignment

public void setCodeTextAlignment(int value)
Specified by:
setCodeTextAlignment in interface IBarCodeControl

getRotationAngle

@Deprecated
public int getRotationAngle()
Deprecated. 

Obsoleted, Use RotationAngleF instead


getRotationAngleF

public float getRotationAngleF()

BarCode image's rotation angle, measured in degree, e.g. RotationAngleF = 0 or RotationAngleF = 360 means no rotation If RotationAngleF NOT equal to 90, 180, 270 or 0, it may increase the difficulty for the scanner to read the image, please set quality mode to anti-alias

Specified by:
getRotationAngleF in interface IBarCodeControl

setRotationAngleF

public void setRotationAngleF(float value)
Specified by:
setRotationAngleF in interface IBarCodeControl

getCaptionAbove

public Caption getCaptionAbove()
Specified by:
getCaptionAbove in interface IBarCodeControl

setCaptionAbove

public void setCaptionAbove(Caption value)
Specified by:
setCaptionAbove in interface IBarCodeControl

getCaptionBelow

public Caption getCaptionBelow()
Specified by:
getCaptionBelow in interface IBarCodeControl

setCaptionBelow

public void setCaptionBelow(Caption value)
Specified by:
setCaptionBelow in interface IBarCodeControl

getGraphicsUnit

public int getGraphicsUnit()
Specified by:
getGraphicsUnit in interface IBarCodeControl

setGraphicsUnit

public void setGraphicsUnit(int value)
Specified by:
setGraphicsUnit in interface IBarCodeControl

getResolution

public Resolution getResolution()
Specified by:
getResolution in interface IBarCodeControl

setResolution

public void setResolution(Resolution value)
Specified by:
setResolution in interface IBarCodeControl

getPrinterName

public String getPrinterName()

setPrinterName

public void setPrinterName(String value)

getImageQuality

public int getImageQuality()
Specified by:
getImageQuality in interface IBarCodeControl

setImageQuality

public void setImageQuality(int value)
Specified by:
setImageQuality in interface IBarCodeControl

getTextRenderingHint

public int getTextRenderingHint()
Specified by:
getTextRenderingHint in interface IBarCodeControl

setTextRenderingHint

public void setTextRenderingHint(int value)
Specified by:
setTextRenderingHint in interface IBarCodeControl

getAutoSize

public boolean getAutoSize()
Specified by:
getAutoSize in interface IBarCodeControl

setAutoSize

public void setAutoSize(boolean value)
Specified by:
setAutoSize in interface IBarCodeControl

getImageWidth

public float getImageWidth()
Specified by:
getImageWidth in interface IBarCodeControl

setImageWidth

public void setImageWidth(float value)
Specified by:
setImageWidth in interface IBarCodeControl

getImageHeight

public float getImageHeight()
Specified by:
getImageHeight in interface IBarCodeControl

setImageHeight

public void setImageHeight(float value)
Specified by:
setImageHeight in interface IBarCodeControl

getBorderWidth

public float getBorderWidth()
Specified by:
getBorderWidth in interface IBarCodeControl

setBorderWidth

public void setBorderWidth(float value)
Specified by:
setBorderWidth in interface IBarCodeControl

getxDimension

public float getxDimension()
Specified by:
getxDimension in interface IBarCodeControl

setxDimension

public void setxDimension(float value)
Specified by:
setxDimension in interface IBarCodeControl

getyDimension

public float getyDimension()
Specified by:
getyDimension in interface IBarCodeControl

setYDimension

public void setYDimension(float value)
Specified by:
setYDimension in interface IBarCodeControl

getBarHeight

public float getBarHeight()
Specified by:
getBarHeight in interface IBarCodeControl

setBarHeight

public void setBarHeight(float value)
Specified by:
setBarHeight in interface IBarCodeControl

getAspectRatio

public float getAspectRatio()
Specified by:
getAspectRatio in interface IBarCodeControl

setAspectRatio

public void setAspectRatio(float value)
Specified by:
setAspectRatio in interface IBarCodeControl

getMargins

public MarginsF getMargins()
Specified by:
getMargins in interface IBarCodeControl

setMargins

public void setMargins(MarginsF value)
Specified by:
setMargins in interface IBarCodeControl

getSupplementSpace

public float getSupplementSpace()
Specified by:
getSupplementSpace in interface IBarCodeControl

setSupplementSpace

public void setSupplementSpace(float value)
Specified by:
setSupplementSpace in interface IBarCodeControl

getPostnetShortBarHeight

public float getPostnetShortBarHeight()
Specified by:
getPostnetShortBarHeight in interface IBarCodeControl

setPostnetShortBarHeight

public void setPostnetShortBarHeight(float value)
Specified by:
setPostnetShortBarHeight in interface IBarCodeControl

getPlanetShortBarHeight

public float getPlanetShortBarHeight()
Specified by:
getPlanetShortBarHeight in interface IBarCodeControl

setPlanetShortBarHeight

public void setPlanetShortBarHeight(float value)
Specified by:
setPlanetShortBarHeight in interface IBarCodeControl

getCodeTextSpace

public float getCodeTextSpace()
Specified by:
getCodeTextSpace in interface IBarCodeControl

setCodeTextSpace

public void setCodeTextSpace(float value)
Specified by:
setCodeTextSpace in interface IBarCodeControl

getBarCodeImage

public BufferedImage getBarCodeImage()
Specified by:
getBarCodeImage in interface IBarCodeControl

getBorderVisible

public boolean getBorderVisible()
Specified by:
getBorderVisible in interface IBarCodeControl

setBorderVisible

public void setBorderVisible(boolean value)
Specified by:
setBorderVisible in interface IBarCodeControl

getBorderColor

public Color getBorderColor()
Specified by:
getBorderColor in interface IBarCodeControl

setBorderColor

public void setBorderColor(Color value)
Specified by:
setBorderColor in interface IBarCodeControl

getBorderDashStyle

public int getBorderDashStyle()
Specified by:
getBorderDashStyle in interface IBarCodeControl

setBorderDashStyle

public void setBorderDashStyle(int value)
Specified by:
setBorderDashStyle in interface IBarCodeControl

getCodabarStartSymbol

public short getCodabarStartSymbol()
Specified by:
getCodabarStartSymbol in interface IBarCodeControl

setCodabarStartSymbol

public void setCodabarStartSymbol(short value)
Specified by:
setCodabarStartSymbol in interface IBarCodeControl

getCodabarStopSymbol

public short getCodabarStopSymbol()
Specified by:
getCodabarStopSymbol in interface IBarCodeControl

setCodabarStopSymbol

public void setCodabarStopSymbol(short value)
Specified by:
setCodabarStopSymbol in interface IBarCodeControl

getCode128CodeSet

public int getCode128CodeSet()
Specified by:
getCode128CodeSet in interface IBarCodeControl

setCode128CodeSet

public void setCode128CodeSet(int value)
Specified by:
setCode128CodeSet in interface IBarCodeControl

getAustralianPosteParcelCodeSet

public int getAustralianPosteParcelCodeSet()

setAustralianPosteParcelCodeSet

public void setAustralianPosteParcelCodeSet(int value)

getEAN128EncodeMode

public int getEAN128EncodeMode()

setEAN128EncodeMode

public void setEAN128EncodeMode(int value)

getAustraliaPostFormatControlCode

public int getAustraliaPostFormatControlCode()
Specified by:
getAustraliaPostFormatControlCode in interface IBarCodeControl

setAustraliaPostFormatControlCode

public void setAustraliaPostFormatControlCode(int value)
Specified by:
setAustraliaPostFormatControlCode in interface IBarCodeControl

getITF14BorderType

public int getITF14BorderType()

setITF14BorderType

public void setITF14BorderType(int value)

getForeAwtColor

public Color getForeAwtColor()
Specified by:
getForeAwtColor in interface IBarCodeControl

setForeColor

public void setForeColor(Color value)
Specified by:
setForeColor in interface IBarCodeControl

getBackColor

public Color getBackColor()
Specified by:
getBackColor in interface IBarCodeControl

setBackColor

public void setBackColor(Color value)
Specified by:
setBackColor in interface IBarCodeControl

setBackColorInternal

public void setBackColorInternal(Color value)

getEnableChecksum

public boolean getEnableChecksum()
Specified by:
getEnableChecksum in interface IBarCodeControl

setEnableChecksum

public void setEnableChecksum(boolean value)
Specified by:
setEnableChecksum in interface IBarCodeControl

getColumns

public int getColumns()
Specified by:
getColumns in interface IBarCodeControl

setColumns

public void setColumns(int value)
Specified by:
setColumns in interface IBarCodeControl

getRows

public int getRows()

setRows

public void setRows(int value)

getDataMatrixEncodeMode

public int getDataMatrixEncodeMode()

setDataMatrixEncodeMode

public void setDataMatrixEncodeMode(int value)

getPdf417CompactionMode

public int getPdf417CompactionMode()
Specified by:
getPdf417CompactionMode in interface IBarCodeControl

setPdf417CompactionMode

public void setPdf417CompactionMode(int value)
Specified by:
setPdf417CompactionMode in interface IBarCodeControl

getPdf417Truncate

public boolean getPdf417Truncate()
Specified by:
getPdf417Truncate in interface IBarCodeControl

setPdf417Truncate

public void setPdf417Truncate(boolean value)
Specified by:
setPdf417Truncate in interface IBarCodeControl

getPdf417ErrorLevel

public int getPdf417ErrorLevel()
Specified by:
getPdf417ErrorLevel in interface IBarCodeControl

setPdf417ErrorLevel

public void setPdf417ErrorLevel(int value)
Specified by:
setPdf417ErrorLevel in interface IBarCodeControl

getMacroPdf417LastSegment

public boolean getMacroPdf417LastSegment()

setMacroPdf417LastSegment

public void setMacroPdf417LastSegment(boolean value)

getMacroPdf417SegmentID

public int getMacroPdf417SegmentID()

setMacroPdf417SegmentID

public void setMacroPdf417SegmentID(int value)

getMacroPdf417FileID

public int getMacroPdf417FileID()

setMacroPdf417FileID

public void setMacroPdf417FileID(int value)

getWideNarrowRatio

public float getWideNarrowRatio()
Specified by:
getWideNarrowRatio in interface IBarCodeControl

setWideNarrowRatio

public void setWideNarrowRatio(float value)
Specified by:
setWideNarrowRatio in interface IBarCodeControl

getSupplementData

public String getSupplementData()
Specified by:
getSupplementData in interface IBarCodeControl

setSupplementData

public void setSupplementData(String value)
Specified by:
setSupplementData in interface IBarCodeControl

getQRErrorLevel

public int getQRErrorLevel()

Level of Reed-Solomon error correction for QR barcode. From low to high: LevelL, LevelM, LevelQ, LevelH. see Aspose.BarCode.QRErrorLevelQRErrorLevel.


setQRErrorLevel

public void setQRErrorLevel(int value)

getQREncodeMode

public int getQREncodeMode()

QR symbology type of BarCode's encoding mode, default mode is Auto


setQREncodeMode

public void setQREncodeMode(int value)

getAztectErrorLevel

public int getAztectErrorLevel()

Level of error corection of Aztect types of barcode. value should between 10 to 95


setAztectErrorLevel

public void setAztectErrorLevel(int value)

getImageUnit

@Deprecated
public int getImageUnit()
Deprecated. 

Obsoleted, Use GraphicsUnit instead


setImageUnit

@Deprecated
public void setImageUnit(int value)
Deprecated. 


saveImageAs

public void saveImageAs(String filename)

Save the barcode image

Parameters:
filename - Full path of the target image file

saveImageAs

public void saveImageAs(InputStream stream,
                        com.aspose.barcode.ImageFormat format)

saveImageAs

@Deprecated
public void saveImageAs(String filename,
                                   com.aspose.barcode.ImageFormat format)
Deprecated. 

Save barcode image to local file.

Parameters:
filename - The filename
format - The image format

setAlwaysShowChecksum

public void setAlwaysShowChecksum(boolean value)

generateBarCodeImage

public BufferedImage generateBarCodeImage()

Generate the BarCode image under current settings


rotate

public void rotate()

Rotate barcode image clockwise for 90 degrees

Specified by:
rotate in interface IBarCodeControl

rotate

public void rotate(float angle)

Rotate barcode image clockwise

Specified by:
rotate in interface IBarCodeControl
Parameters:
angle - Rotation Angle

rotate

public void rotate(int direction,
                   float angle)

Rotate the barcode image

Specified by:
rotate in interface IBarCodeControl
Parameters:
direction - rotation direction
angle - rotation angle

rotate

public void rotate(int angle)

Rotate the barcode image

Specified by:
rotate in interface IBarCodeControl
Parameters:
angle - either 0, 90, 180 or 270 degree

rotate

public void rotate(int direction,
                   int angle)

Rotate the barcode image

Specified by:
rotate in interface IBarCodeControl
Parameters:
direction - specify clockwise or anti-clockwise
angle - either 0, 90, 180 or 270 degree

save

public void save(OutputStream stream,
                 int format)

save

public void save(InputStream stream,
                 com.aspose.barcode.ImageFormat format)
Specified by:
save in interface IBarCodeControl

save

public void save(InputStream stream,
                 int format)

save

public void save(String filename)

Save BarCodeImage to specific file in specific format

Specified by:
save in interface IBarCodeControl
Parameters:
filename - save to this file path

save

public void save(String filename,
                 com.aspose.barcode.ImageFormat format)
Save BarCodeImage to specific file in specific format

Specified by:
save in interface IBarCodeControl

save

public void save(String filename,
                 int format)
Save BarCodeImage to specific file in specific format

Parameters:
filename - save to this file path
format - Specifies the file format of the image.

toString

public String toString()

overried to string method

Overrides:
toString in class Object


Copyright (c) 2002-2012 Aspose Pty Ltd. All Rights Reserved.