Java Barcode PDF 417 Generator
Barcode PDF-417 Generation in Java Class, Jasper Reports, iReport, BIRT
Java Barcode offers the most affordable Java barcode generator for barcode Java professionals.
Java PDF-417 Introduction
PDF-417 is also known as Portable Data File 417, PDF 417, PDF417 Truncated
PDF417, or Portable Data File 417,
is a two-dimensional stacked barcode symbology capable of encoding over a
kilobyte of data per label. It was developed by Symbol Technologies (1989-1992)
and is currently maintained by ANSI / AIM USA.
Large amounts of text and data can be stored securely and inexpensively when
using the PDF417 symbology. The printed symbol consists of several linear rows
of stacked codewords. Each codeword represents 1 of 929 possible values from
one of three different clusters. A different cluster is chosen for each row,
repeating after every three rows.
Java Barcode PDF 417 Generator - How to generate barcode PDF-417 in Java Class?
The following Java code illustrates how to generate a barcode in Java class:
PDF417 barcode = new PDF417();
barcode.setCodeText("PDF417");
BufferedImage pdf417Image = barcode.drawBarCode2Image();
Java Barcode PDF 417 Generator - How to generate PDF-417 barcodes to Java Servlet applicatons?
The following Java code illustrates how to generate a barcode in Java Servlet class:
public class BarcodeServlet extends HttpServlet {
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException
{
try {
PDF417 barcode = new PDF417();
barcode.setCodeText("PDF417");
ServletOutputStream servletoutputstream = response.getOutputStream();
barcode.drawBarCode2Stream(servletoutputstream);
} catch (Exception e) {
throw new ServletException(e);
}
}
}
Java Barcode PDF 417 Generator - How to create PDF-417 barcodes through HTTP Request?
-
Install Java Barcode Generator Servlet application to Tomcat or JBoss, developers need copy the barcode folder to your Tomcat application folder, and restart the Tomcat.
-
After Tomcat restarted, open your browser and navigate to http://your_tomcat_url:port/barcode/pdf417?code-text=PDF417
-
You can also insert barcodes in HTML or JSP pages.
<img src="http://your_tomcat_url:port/barcode/pdf417?code-text=PDF417">
Java Barcode PDF 417 Generator - How to draw & print barcode PDF-417 to java.awt.Image Object
The following Java source code shows how to generate a barcode in a java.awt.Image object:
private static void demoLinearBarcode() throws Exception
{
PDF417 barcode = new PDF417();
barcode.setCodeText("PDF417");
java.awt.image.BufferedImage image = new java.awt.image.BufferedImage(300,300,java.awt.image.BufferedImage.TYPE_BYTE_INDEXED );
java.awt.Graphics2D imgGraphics = image.createGraphics();
barcode.paintBarCode(imgGraphics, new java.awt.Rectangle(0, 0, 300, 300));
}
Java PDF-417 Properties
| Class Properties |
HTTP Parameters |
Default |
Comments |
| data |
data |
"" |
Barcode value to encode |
| uom |
uom |
PIXEL |
Unit of meature for all size related settings. 0: pixel; 1: cm; 2: inch. Default is pixel |
| X |
x |
1 |
Width of barcode module (narrow bar), default is 1 pixel |
| barRatio |
bar-ratio |
3 |
bar height, bar width ratio |
| leftMargin |
left-margin |
0 |
Barcode image left margin |
| rightMargin |
right-margin |
0 |
Barcode image right margin |
| topMargin |
top-margin |
0 |
Barcode image top margin |
| bottomMargin |
bottom-margin |
0 |
Barcode image bottom margin |
| resolution |
resolution |
72 |
Barcode image resolution in dpi |
| rotate |
rotate |
0 |
Barcode rotate angle, valid values: 0, 90, 180, 270 |
| 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 (MODE_TEXT) |
valid values: 0 (MODE_AUTO), 1 (MODE_TEXT), 2 (MODE_BYTE), 3(MODE_NUMERIC) |
| ecl |
ecl |
2 (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 |
Java Barcode Generator supports most common linear (1d) and matrix (2d) bar code standards, including: