KA.Barcode for ASP.NET
How to Print PDF-417 in ASP.NET with Valid Data
ASP.NET source code to generate, print PDF-417 images using Barcode Generator for .NET Control
  • Professional PDF-417 bar code generation component for ASP.NET
  • Create & print truncated PDF-417 and Macro PDF-417 barcodes in ASP.NET website/ webform, IIS
  • .NET barcode, .NET WinForms barcode, Java barcode, barcode ASP.NET & barcode Excel provided
  • Provide different data modes to simplify PDF-417 barcode encoding of all ASCII characters
  • Using "~"to specify special characters in the input data
  • Check PDF-417 input data with 9 different levels of Reed-Solomon algorithm
  • Accurate PDF-417 creation according to ISO / IEC 15438 (2nd edition 2006-06-01)
  • Robust, flexible 2D PDF-417 generating control used world-wide
  • Thermal printer support for PDF417 output with outstanding quality even on low-resolution printers
  • Draw and export high-quality Code 128 .NET WinForms, ASP.NET UPC-A, UPC-A Excel barcodes as you wish
  • Purchase with flexible royalty-free Developer Licenses
PDF-417 barcode device library for ASP.NET is one function of KA.Barcode for ASP.NET for add advanced pdf-417 creation features in ASP.NET programs as well as IIS. It provides strong named assemblies for ASP.NET 2.0 & 3.5 and draw PDF-417 barcodes in image files as well as in the memory. This article is a guidance to encode PDF-417 barcode data in ASP.NET webform/ web page, IIS; more information on PDF417 barcode size and image:
PDF-417 Information
PDF-417 is a bidimensional barcode symbology also named Portable Data File 417, PDF 417, PDF417 Truncated.

PDF-417 for ASP.NET encodes:

  • ASCII characters 0-127 including letters A-Z, a-z, and numeric digits 0-9, etc
  • ASCII characters 128 to 255 (character with byte values)

PDF-417 for ASP.NET data capacity:

  • Text (max): 1,726 characters
  • Byte (max): 1,033 bytes
  • Numeric (max): 2,710 characters
PDF-417 Data Encoding in KA.Barcode Generator for ASP.NET

PDF-417 Data Encoding with C#, VB.NET Class in ASP.NET

  1. 1.
  2. 2.
    Add reference: Add "KeepAutomation.Barcode.Web.dll" to your ASP.NET project reference
  3. 3.
    Add to toolbox: To add BarcodeControl to your ASP.NET toolbox
Copy the following C#/ VB.NET barcode procedure onto you forms to produce, insert PDF417 in ASP.NET website/ web pages:
using KeepAutomation.Barcode.Bean;
BarCode barcode= new BarCode();
barcode.Symbology= KeepAutomation.Barcode.Symbology.PDF417;
barcode.CodeToEncode = "PDF-417";
barcode.generateBarcodeToImageFile("C://barcode-pdf417-csharp.gif");
Dim barcode As KeepAutomation.Barcode.Bean.BarCode = New KeepAutomation.Barcode.Bean.BarCode

barcode.Symbology= KeepAutomation.Barcode.Symbology.PDF417
barcode.CodeToEncode = "PDF-417"
barcode.generateBarcodeToImageFile("C://barcode-pdf417-vbnet.gif")
PDF-417 Text Mode encodes the following data. Copy the barcode program to encode text string to PDF417 in ASP.NET MVC.
  • Upper case alphabetic: A-Z
  • Lower case alphabetic: a-z
  • Mixed character: numeric and some punctuation
  • Punctuation
barcode.PDF417DataMode = KeepAutomation.Barcode.PDF417DataMode.Text;
barcode.CodeToEncode = "PDF-417";
barcode.PDF417DataMode = KeepAutomation.Barcode.PDF417DataMode.Text
barcode.CodeToEncode = "PDF-417"

Printing PDF-417 with Byte Mode

PDF-417 barcode generator for ASP.NET also supports to encode 8-bit bytes into PDF-417 barcodes in accordance with ISO/IEC 8859-1 and ISO/IEC 646 (byte value 00-31). Copy the following sample code with following to transform stream to PDF417 image:
barcode.PDF417DataMode = KeepAutomation.Barcode.PDF417DataMode.Byte;
barcode.CodeToEncode = "-*&^*(";
barcode.PDF417DataMode = KeepAutomation.Barcode.PDF417DataMode.Byte
barcode.CodeToEncode = "-*&^*("

Creating PDF-417 with Numeric Mode

PDF-417 barcode generator for ASP.NET allows users to encode numeric data: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9. Replace sample code with following one to convert numeric value into PDF417 images:
barcode.PDF417DataMode = KeepAutomation.Barcode.PDF417DataMode.Numeric;
barcode.CodeToEncode = "144149749";
barcode.PDF417DataMode = KeepAutomation.Barcode.PDF417DataMode.Numeric
barcode.CodeToEncode = "144149749"
PDF-417 Data Encoding with Drag & Drop BarcodeControl
  1. 1.
    In "Choose Toolbox Items" form, click button "Browse...", and select KeepAutomation.Barcode.Web.dll
  2. 2.
    Now you'll see BarCodeControl in your toolbox
  3. 3.
    Drag and drop the BarCodeControl into the Forms and a Codabar image is generated
  4. 4.
    Open your barcode setting panel, choose "Symbology" to "PDF417"
  5. 5.
    Then input PDF-417 valid character in "CodeToEncode" accordingly
  6. 6.
    You may choose different PDF-417 Data Mode in "PDF417DataMode"
  7. 7.
    A PDF-417 barcode with different characters occurs
PDF-417 Data Encoding in Internet Information Service (IIS)
  1. 1.

    Copy folder "barcode" in your download the trial package to your IIS web application folder
  2. 2.
    Create a virtual directory, named "barcode", and link to your just copied "barcode" folder
  3. 3.
    Restart IIS and now you have successfully installed the ASP.NET Barcode Generator web application
  4. 4.
    To test it, open your web browser, and navigate to "http://localhost/barcode/barcode.aspx?symbology=102&code-to-encode=0123456789"
  5. 5.
    A PDF-417 barcode with numeric data will be displayed
Note: In IIS, Symbology.PDF417 is 102. For different data mode, PDF417DataMode.Auto is 0; PDF417DataMode.Text is 1; PDF417DataMode.Byte is 2; and PDF417DataMode.Numeric is 3. Users may write "symbology=102&code-to-encode=xxx" or "symbology=102&pdf417-data-mode=x&code-to-encode=xxx" accordingly to change encoded data.