createBarcode

Navigation:  Tutorials > iReport > ImageFactory Class > Methods >

createBarcode

Previous pageReturn to chapter overviewNext page

Returns an Image object containing a barcode.

public static Image createBarcode(int barcodeType, String data, double narrowBarWidth, int rotation, int resolution,

                                                  double barHeight, int fontSize, boolean showText, boolean addCheckDigit,

                                                  boolean addCheckDigitToText, double borderWidth, String supplement,

                                                  int supplementType, double supplementGap, String imageFormat)


Parameters

barcodeType

Specifies the barcode type, a valid value should be between 1 and 91. Please refer to Symbology Type Constants

 

data

Specifies a string which will be encoded by a barcode.

 

narrowBarWidth

Specifies the narrow bar width in centimeters.

 

moduleSize

Specifies the size (width/height) in centimeters of a square-shaped module.

 

rotation

Specifies the orientation of the barcode, a valid value should be 0, 1,  2, or 3. Please refer to Orientation Constants

 

resolution

Specifies the resolution (DPI) of a device onto which a barcode will be rendered. The default value is 96 for computer screen.

 

barHeight

Specifies the barcode height in centimeters. The default value is 1.5.

 

fontSize

Specifies the font size of the human readable text in the barcode.

 

showText

Sets a boolean flag indicating whether or not the human readable text should be displayed.

 

addCheckDigit

Sets a boolean flag indicating whether or not a check digit is required.

 

addCheckDigitToText

Sets a boolean flag indicating whether or not a check digit is added to the human readable text.

 

borderWidth

Specifies the border width in centimeters.

 

supplement

Specifies a supplement string for a UPC or EAN related barcode.

 

supplementType

Specifies the supplement type, a valid value should be 0, 1, or 2. Please refer to Supplement Type Constants

 

supplementGap

Specifies the distance, in centimeters, between the normal barcode and the supplement section.

 

imageFormat

Specifies barcode image format, it can be "bmp", "jpg", or "png".