|
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.
PDF 417 is a stacked linear bar code symbol used in a variety of applications, primarily transport, identification cards, and inventory management. PDF stands for Portable Data File. The PDF417 symbology was invented by Dr. Ynjiun P. Wang at Symbol Technologies in 1991.
Java PDF 417 Generator encodes:
// Create Java PDF417 object PDF417 barcode = new PDF417(); // Set PDF417 data text to encode barcode.setData("PDF417-IN-JAVA"); // Generate PDF417 barcode & print into Graphics2D object barcode.drawBarcode("Java Graphics2D object"); // Generate PDF417 barcode & encode into GIF format barcode.drawBarcode("C://barcode-pdf417.gif"); // Generate PDF417 barcode & encode into JPEG format barcode.drawBarcode("C://barcode-pdf417.jpg");
// Create Java PDF417 object PDF417 barcode = new PDF417(); // Set PDF417 data text to encode barcode.setData("Create PDF417 in EPS"); // Generate PDF417 barcode & encode into EPS barcode.drawBarcode2EPS("C://barcode-pdf417.eps");
import com.onbarcode.barcode.AbstractBarcode; import com.onbarcode.barcode.PDF417; 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 { PDF417 barcode = new PDF417(); barcode.setData("PDF417"); ServletOutputStream servletoutputstream = response.getOutputStream(); response.setContentType("image/jpeg"); response.setHeader("Pragma", "no-cache"); response.setHeader("Cache-Control", "no-cache"); response.setDateHeader("Expires", 0); // Generate PDF-417 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 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| PDF 417 Special |
processTilde | PROCESS-TILDE | false | Set the processTilde property to true, if you want use the tilde character "~" to specify special characters in the input data. Default is false.
~NNN: is used to represent the ASCII character with the value of NNN. NNN is from 000 - 255. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| dataMode | DATA-MODE | 1 (M_TEXT) | valid values: 0 (M_AUTO), 1 (M_TEXT), 2 (M_BYTE), 3(M_NUMERIC) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ecl | ECL | 2 | Error correction level, values are from 0 to 8, default is 2. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| rowCount | ROW-COUNT | 3 | The number of rows for PDF417. The value range is from 3 to 90. The default is 3. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| columnCount | COLUMN-COUNT | 5 | Number of columns. The value range is from 1 to 30. The default is 5. Increase this value, if your data size is large. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| truncated | TRUNCATED | false | truncated PDF417 may be used where space considerations are a primary concern and symbol damage is unlikely. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| isMacro | MACRO | false | Set isMacro property to true, then Macro PDF417 is enabled. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| macroSegmentIndex | MACRO-SEGMENT-INDEX | 0 | the position of current symbol in the secuence (Start with 0). | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| macroSegmentCount | MACRO-SEGMENT-COUNT | 0 | the number of total symbols which make the sequence. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| macroFileIndex | MACRO-FILE-INDEX | 0 | be identified to the same file | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Size Related | uom | UOM | 0 | Unit of meature for all size related setting in the library.
0: pixel; 1: inch; 2: cm. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| X | X | 2 | width of barcode module (narrow bar), default is 2 pixel | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| XtoYRatio | X-Y-RATIO | 0.3333333f | bar width, bar height ratio | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 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) |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||