MSI Plessey Barcode Property Settings





MSI Plessey Property Settings


Barcode Java Class: com.onbarcode.barcode.MSI.
Category Properties Value Comments
Basic Property: data
URL: DATA
Type: String
Default: ""
Barcode value to encode

MSI Valid Data Char Set:
  • 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 (Digits)

Property: addCheckSum
URL: ADD-CHECK-SUM
Type: boolean
Default: false
For MSI.CHECKSUM_AUTO, addCheckSum is optional. Modulo 10 will be applied, if addCheckSum property is true.

For MSI.CHECKSUM_10, MSI.CHECKSUM_11, MSI.CHECKSUM_1010, MSI.CHECKSUM_1110, addCheckSum is not applicable. Java Barcode will always add check character(s) for you.
 
MSI
Special
Property: checksumType
URL: CHECKSUM-TYPE
Type: int
Default: 0 (MSI.CHECKSUM_AUTO)
Valid values:
  • 0 (MSI.CHECKSUM_AUTO)
  • 1 (MSI.CHECKSUM_10)
  • 2 (MSI.CHECKSUM_11)
  • 3 (MSI.CHECKSUM_1010)
  • 4 (MSI.CHECKSUM_1110)
 
Barcode
Size
Related
Property: uom
URL: UOM
Type: int
Default: 0 (pixel)
Unit of meature for all size related settings in the library.
Valid values: 0: pixel; 1: inch; 2: cm.
Property: X
URL: X
Type: float
Default: 1
Width of barcode bar module (narrow bar), default is 1 pixel
Property: Y
URL: Y
Type: float
Default: 30
Height of barcode bar module, default is 30 pixel
Property: barcodeWidth
URL: BARCODE-WIDTH
Type: float
Default: 0
Barcode image width.

If barcodeWidth setting is smaller than the barcode required minimum width, the library will automatically reset to barcode minimum width.
Property: barcodeHeight
URL: BARCODE-HEIGHT
Type: float
Default: 0
Barcode image height.

If barcodeHeight setting is smaller than the barcode required minimum height, the library will automatically reset to barcode minimum height.
Property: leftMargin
URL: LEFT-MARGIN
Type: float
Default: 0
Barcode image left margin size.
Property: rightMargin
URL: RIGHT-MARGIN
Type: float
Default: 0
Barcode image right margin size.
Property: topMargin
URL: TOP-MARGIN
Type: float
Default: 0
Barcode image top margin size.
Property: bottomMargin
URL: BOTTOM-MARGIN
Type: float
Default: 0
Barcode image bottom margin size.
Property: resolution
URL: RESOLUTION
Type: int
Default: 72
Barcode image resolution in DPI (Dots per inch).
Property: rotate
URL: ROTATE
Type: int
Default: 0 (IBarcode.ROTATE_0)
Valid values:

  • 0 (IBarcode.ROTATE_0)
  • 1 (IBarcode.ROTATE_90)
  • 2 (IBarcode.ROTATE_180)
  • 3 (IBarcode.ROTATE_270)
 
Font
Style
Property: showText
URL: SHOW-TEXT
Type: boolean
Default: true
If true, display barcode data text under the barcode, otherwise do not display.
Property: textFont
URL: TEXT-FONT
Type: Font
Default:
new Font("Arial", Font.PLAIN, 11)
Barcode text font style.

In Java Servlet web streaming, using the url paramter in the following format:
&TEXT-FONT=Arial|bold|9
Property: textMargin
URL: TEXT-MARGIN
Type: float
Default: 6
Space between barcode and barcode data text, default is 6 pixel
 
Methods
// generate barcode and output to OutputStream object
public boolean drawBarcode(OutputStream outputStream) throws Exception

// generate barcode into a new BufferedImage object
public BufferedImage drawBarcode() throws Exception

/*
    Use this method to generate barcode, and save into gif or jpeg files
    1. to save into gif file, filename ends with ".gif", like "c:\\barcode.gif"
    2. to save into jpeg file, filename ends with ".jpg", like "c:\\barcode.jpg"
*/
public byte[] drawBarcodeToBytes() throws Exception

public boolean drawBarcode(String imageFile) throws Exception

// Generate barcode and save into EPS file, the filename must ends with ".eps"
public void drawBarcode2EPS(String filename) throws Exception

// Generate barcode on Graphics2D object within certain area
public void drawBarcode(Graphics2D g, Rectangle2D rectangle) throws Exception
 

MSI Properties in the Java Program

Generating barcode MSI in Java Class example

	MSI barcode = new MSI();
	
	/*
	   MSI Plessey Valid data char set:
	        0, 1, 2, 3, 4, 5, 6, 7, 8, 9 (Digits)
	*/
	barcode.setData("112233445566");
	
	barcode.setChecksumType(MSI.CHECKSUM_AUTO);
	
	// addCheckSum is for MSI.CHECKSUM_AUTO, 
	// not valid for  CHECKSUM_10, CHECKSUM_11, CHECKSUM_1010, CHECKSUM_1110.
	barcode.setAddCheckSum(true);
	
	// Unit of Measure, pixel, cm, or inch
	barcode.setUom(IBarcode.UOM_PIXEL);
	// barcode bar module width (X) in pixel
	barcode.setX(3f);
	// barcode bar module height (Y) in pixel
	barcode.setY(75f);
	
	// barcode image margins
	barcode.setLeftMargin(0f);
	barcode.setRightMargin(0f);
	barcode.setTopMargin(0f);
	barcode.setBottomMargin(0f);
	
	// barcode image resolution in dpi
	barcode.setResolution(72);
	
	// disply barcode encoding data below the barcode
	barcode.setShowText(true);
	// barcode encoding data font style
	barcode.setTextFont(new Font("Arial", 0, 12));
	// space between barcode and barcode encoding data
	barcode.setTextMargin(6);
	
	//  barcode displaying angle
	barcode.setRotate(IBarcode.ROTATE_0);
	
	barcode.setAddCheckSum(true);
	
	/*
	  to save into gif file, file name end with .gif
	  to save into jpeg file, file name end with .jpg
	  to save into eps file, call method drawBarcode2EPS and file name end with .eps
	*/
	barcode.drawBarcode("C:\\msi.gif");



Barcode Types