|
No. 1 Bar Code SDK Provider for Java/.NET/Objective-C Professionals
|
Java Barcode is a Java barcode generator which generates high quality 1D (linear) and 2D (matrix) barcodes in Java, Jasper Reports, iReport, and Eclipse BIRT projects.
MSI Plessey is a 1D linear barcode symbology based on Pulse Wide Modulation, developed in 1971 by The Plessey Company plc, a British-based company.
Java MSI Generator encodes:
// Create Java MSI Plessey object MSI barcode = new MSI(); // Set MSI Plessey data text to encode barcode.setData("0123456789"); // Generate MSI Plessey barcode & print into Graphics2D object barcode.drawBarcode("Java Graphics2D object"); // Generate MSI Plessey barcode & encode into GIF format barcode.drawBarcode("C://barcode-msi.gif"); // Generate MSI Plessey barcode & encode into JPEG format barcode.drawBarcode("C://barcode-msi.jpg");
// Create Java MSI object MSI barcode = new MSI(); // Set MSI data text to encode barcode.setData("0123456789"); // Generate MSI barcode & encode into EPS barcode.drawBarcode2EPS("C://barcode-msi.eps");
import com.onbarcode.barcode.AbstractBarcode; import com.onbarcode.barcode.MSI; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.ServletException; import javax.servlet.ServletOutputStream; public class BarcodeServlet extends HttpServlet { public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException { try { MSI barcode = new MSI(); barcode.setData("0123456789"); ServletOutputStream servletoutputstream = response.getOutputStream(); response.setContentType("image/jpeg"); response.setHeader("Pragma", "no-cache"); response.setHeader("Cache-Control", "no-cache"); response.setDateHeader("Expires", 0); // Generate MSI Plessey barcode & output to ServletOutputStream barcode.drawBarcode(servletoutputstream); } catch (Exception e) { throw new ServletException(e); } } }
1) You can set barcode image width and height through properties barcodeWidth and barcodeHeight values.
or
2) You can set X (bar module width) and Y (bar module height) values
| Category | Class Properties | Servlet Properties | Default | Comments | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Basic | data | DATA | "" | value to encode | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| addCheckSum | ADD-CHECK-SUM | true |
For checksumType is 0 (CHECKSUM_AUTO), addCheckSum is optional. Modulo 10 will be applied, if addCheckSum property is true.
For checksumType is 1 (CHECKSUM_10), addCheckSum is not applicable. Barcode Library will always add check character with Modulo 10. For checksumType is 2 (CHECKSUM_11), addCheckSum is not applicable. Barcode Library will always add check character with Modulo 11 using IBM algorithm. For checksumType is 3 (CHECKSUM_1010), addCheckSum is not applicable. Barcode Library will always calculate the Modulo 10 check digit the first time and then calculate it again with the previous result and append the result of the second Modulo 10 Calculation to the string to be encoded. For checksumType is 4 (CHECKSUM_1110), addCheckSum is not applicable. Barcode Library will always calculate the Modulo 11 check digit the first time and then calculate it again with the previous result and append the result of the second Modulo 10 Calculation to the string to be encoded. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| MSI Special |
checksumType | CHECKSUM-TYPE | CHECKSUM_AUTO (0) | valid values:
CHECKSUM_AUTO (0) CHECKSUM_10 (1) CHECKSUM_11 (2) CHECKSUM_1010 (3) CHECKSUM_1110 (4) |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Size Related | uom | UOM | 0 | Unit of meature for all size related setting in the library.
0: pixel; 1: inch; 2: cm. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| X | X | 1 | width of barcode module (narrow bar), default is 1 pixel | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Y | Y | 30 | barcode module height, default is 30 pixel | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| barcodeWidth | BARCODE-WIDTH | 0 | generted barcode image width | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| barcodeHeight | BARCODE-HEIGHT | 0 | generted barcode image height | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| leftMargin | LEFT-MARGIN | 0 | image left margin | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| rightMargin | RIGHT-MARGIN | 0 | image right margin | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| topMargin | TOP-MARGIN | 0 | image top margin | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| bottomMargin | BOTTOM-MARGIN | 0 | image bottom margin | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| resolution | RESOLUTION | 72 | in DPI | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| rotate | ROTATE | IBarcode.ROTATE_0 (0) | valid values:
IBarcode.ROTATE_0 (0), IBarcode.ROTATE_90 (1), IBarcode.ROTATE_180 (2), IBarcode.ROTATE_270 (3) |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Text & Color |
showText | SHOW-TEXT | true | If true, display barcode data text, otherwise do not display. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| showCheckSumChar | SHOW-CHECKSUM-CHAR | true | If true, display the check sum character in the end of data, if there is a check sum. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| textFont | TEXT-FONT | Arial, Plain, 11 | Barcode text font style | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| textMargin | TEXT-MARGIN | 6 | Space between barcode and barcode data text, default is 6 pixel | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||