PDF417 for Java
Barcode Java > Barcode in Java > 2D > PDF417

PDF417 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 prints:
  • all 128 characters of ASCII
  • values 128-255 in accordance with ISO 8859-1. There are referred to as extended ASCII.
Java PDF-417 Barcode Generator - Common Questions

1. How to generate PDF-417 barcodes in JSP & HTML pages?

  1. Copy "barcoding" folder contents to your Java Servlet container like Tomcat or JBoss's applications folder
  2. Restart your Java Servlet container
  3. Open your web browser like IE, Firefox, and navigate to http://localhost:8080/barcoding/pdf417?DATA=0123456789
  4. To generate PDF417 barcode images in JSP or HTML pages, insert the following html img tag code:
    <img src="http://localhost:8080/barcoding/pdf417?DATA=0123456789" border=0 />

2. How to create PDF-417 barcodes in Java Servlet?

        try {
            PDF417 barcode = new PDF417();
            barcode.setCode("Java PDF417 Generation");

            response.setHeader("Pragma", "no-cache");
            response.setHeader("Cache-Control", "no-cache");
            response.setDateHeader("Expires", 0);
            ServletOutputStream servletoutputstream = response.getOutputStream();


        } catch (Exception e) {
            throw new ServletException(e);

3. How to generate PDF-417 barcodes in Java Class?

        PDF417 barcode = new PDF417();
        barcode.setCode("Create PDF-417 in Java Class");

4. How to draw PDF-417 barcodes to image files?

        PDF417 barcode = new PDF417();
        barcode.setCode("Generate & encode PDF417 images in Java");

5. How to draw & print PDF-417 barcodes to Java image objects or stream objects?

        PDF417 barcode = new PDF417();
        barcode.drawOnGraphics("Graphics2D object");
        barcode.drawOnStream("OutputStream object");
Java Barcode PDF-417 Generator - PDF-417 Property Settings

  • code : PDF-417 encoding data value.

    Servlet Parameter: code; Default Value: ""

  • dataMode : PDF-417 encoding data mode.

    Servlet Parameter: data-mode; Default Value: 1 (MODE_TEXT)

  • ecl : PDF-417 error correction level

    Servlet Parameter: ecl; Default Value: 2 (ECL_2)

  • rowCount

    Servlet Parameter: row-count; Default Value: 3

  • columnCount

    Servlet Parameter: column-count; Default Value: 5

  • truncated

    Servlet Parameter: truncated; Default Value: false

Barcode Size

  • barcodeUnit : Unit of meature for all size related properties. 0: Pixel (default); 1: CM; 2: Inch.

    Servlet Parameter: barcode-unit; Default Value: 0 (UOM_PIXEL)

  • barWidth : bar module width (X), default is 1 pixel

    Servlet Parameter: bar-width; Default Value: 1.0f

  • barRatio : bar module height vs bar module width ratio

    Servlet Parameter: bar-ratio; Default Value: 3

  • leftMargin : generated barcode image left margin

    Servlet Parameter: left-margin; Default Value: 0.0f

  • rightMargin : generated barcode image right margin

    Servlet Parameter: right-margin; Default Value: 0.0f

  • topMargin : generated barcode image top margin

    Servlet Parameter: top-margin; Default Value: 0.0f

  • bottomMargin : generated barcode image bottom margin

    Servlet Parameter: bottom-margin; Default Value: 0.0f

  • resolution : generated data matrix image resolution in dpi

    Servlet Parameter: resolution; Default Value: 72 dpi

  • rotate : barcode data matrix rotate angle, valid values: 0 (ROTATE_0), 1 (ROTATE_90), 2 (ROTATE_180), 3 (ROTATE_270)

    Servlet Parameter: rotate; Default Value: 0 (ANGLE_0)

  • barcodeWidth

    Servlet Parameter: barcode-width; Default Value: 0

  • barcodeHeight

    Servlet Parameter: barcode-height; Default Value: 0

Macro PDF-417

  • isMacro

    Servlet Parameter: macro; Default Value: false

  • macroSegmentIndex

    Servlet Parameter: macro-segment-index; Default Value: 0

  • macroSegmentCount

    Servlet Parameter: macro-segment-count; Default Value: 0

  • macroFileIndex

    Servlet Parameter: macro-file-index; Default Value: 0

Java Barcode Generator Supporting Barcode Symbology Types

Quick Links