Home  >  .NET Barcode Generator Suite  >  .NET Barcode Generation Guide  >  .NET PDF417 Barcoding Library
.NET PDF 417 Barcode Generator Control for C#, VB.NET
.NET PDF 417 Barcode Generator Control is an advanced developer-library for .NET programmers. It supports PDF417 barcode generation in .NET projects, ASP.NET web application, Windows Forms project & Console application using C# or VB.NET class codes.
Introduction for .NET PDF-417 Barcode
PDF-417 is also known as Portable Data File 417, PDF 417, PDF417 Truncated, which 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.
Tutorial for PDF417 Barcode Generation in .NET Windows Forms Controller
The drag & drop function of this .NET PDF417 barcode generator control makes it extremely easy to create & print 2d PDF417 barcode images in .NET Windows Forms programs.
  1. Find & integrate KeepDynamic.BarCode.Windows.dll to your WinForms project & Visual Studio Toolbox
  2. Check four new items are visible on the toolbox, that is, BarCodeControl, PDF417Control, QRCodeControl & DataMatrixControl
  3. Drag & drop PDF417Control from the toolbox to your WinForms project and a standard PDF417 barcode will be generated
  4. Click created PDF417 barcode images and change its barcode image properties in the Properties window
Tutorial for PDF417 Barcode Generation in ASP.NET Web Application
Using this .NET PDF417 barcode generating library, you can also generate & create 2d PDF417 barcode images in ASP.NET web controller within three steps.
  1. Add KeepDynamic.BarCode.AspNet.dll to your ASP.NET web project and Visual Studio Toolbox
  2. Copy "pdf417.aspx", "pdf417.aspx.cs" from folder barcode(which is under the folder Documentation)to your ASP.NET project
  3. Drag & drop the PDF417Control item from the Toolbox to your ASP.NET Web form pages and change its other barcode image settings in the Properties window
Tutorial for 2D PDF417 Barcode Generation in C#.NET Project
After installing either KeepDynamic.BarCode.AspNet.dll or KeepDynamic.BarCode.Windows.dll to your C#.NET project, you can generate a PDF417 barcode images using following free sample C# class code.
// Create PDF417 barcode object in C#
PDF417 barcode = new PDF417();

// Set PDF-417 barcode value in C#
barcode.CodeText = "PDF417 in C#";

// set unique PDF 417 barcode image settings
barcode.ColumnCount = 3;
barcode.RowCount = 10;
barcode.X = 3;
barcode.XtoYRatio = 0.3333333f;

// set image size-related property settings
barcode.BottomMargin = 6;
barcode.TopMargin = 6;
barcode.RightMargin = 6;
barcode.LeftMargin = 6;

// Set PDF-417 drawing image format to PNG in C#
barcode.Format = System.Drawing.Imaging.ImageFormat.Png;

// Generate PDF-417 barcode & encode to the png image in C#
barcode.drawBarcode("C://barcode-pdf417.png");
More information of generating PDF417 barcode images in .NET project using C# class code
Tutorial for 2D PDF417 Barcode Generation in VB.NET Application
After install either KeepDynamic.BarCode.AspNet.dll or KeepDynamic.BarCode.Windows.dll to your C#.NET project by adding reference, you can use following sample VB.NET class code to generate & draw PDF417 barcode images in .NET applications.
' Create PDF417 barcode object in VB.NET
Dim barcode As New PDF417()

' Set PDF-417 barcode value in C#
barcode.CodeText = "PDF417 in VB.NET"

' set unique PDF 417 barcode image settings
barcode.ColumnCount = 3
barcode.RowCount = 10
barcode.X = 3
barcode.XtoYRatio = 0.3333333F

' set image size-related property settings
barcode.BottomMargin = 6
barcode.TopMargin = 6
barcode.RightMargin = 6
barcode.LeftMargin = 6

' Set PDF-417 drawing image format to PNG in VB.NET
barcode.Format = System.Drawing.Imaging.ImageFormat.Png

' Generate PDF-417 barcode & encode to the png image in VB.NET
barcode.drawBarcode("C://barcode-pdf417.png")
More information of generating PDF417 barcode images in .NET project using VB.NET class code
.NET PDF-417 2D Barcodes Properties

Barcode properties HTTP Parameters Default Comments
CodeText code-text "" The data that is used to encode into PDF417 symbology. PDF417 symbology standards defines three data compaction modes to encode text, binary, and numbers. The encodable character set of PDF417 consist of:

  • Text: encode values 9,10,13 & 32-127 of ASCII
  • Bytes: encode all 256 byte values of ASCII
  • Numeric: encode numeric digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
GraphicsUnit graphics-unit GraphicsUnit.Pixel The unit of measurement for all size related settings.
  • 0: pixel
  • 1: cm
  • 2: inch
  • The default value is pixel.
X x 1 The width of narrowest bar module of PDF417 symbol and the default value of X dimension is 1 pixels.

The minimum width of a module, the X dimension, should be defined by the application specification
XtoYRatio x-y-ratio 3 The ratio of the width of a module (X Dimension) to row height (Y). Valid ratio of X to Y ranges from 1:2 to 1:5, however, the recommended X to Y ratio is 1:3. Other popular ratios include 1:4 and 1:5.
LeftMargin left-margin 0 The property to set the distance between the symbol and the left margin of a barcode image.
RightMargin right-margin 0 The property to set the distance between the symbol and the right margin of a barcode image.
TopMargin top-margin 0 The property to customize the space between the symbol and the top margin on a barcode image
BottomMargin bottom-margin 0 The property to change the space between the symbol and the bottom margin on a barcode image
Resolution resolution 72 This property set the resolution in DPI of a barcode image to be drawn, and the default value that is set to printer is 72 pixels. You can adjust the value to get a custom resolution barcode image.
Rotate rotate 0 The Rotate property allows you changing the angle of a barcode. The valid values are:
  • Rotate0: do not rotate the barcode
  • Rotate90: rotate the barcode 90 degrees clockwise
  • Rotate180: rotate the barcode 180 degrees clockwise
  • Rotate270: rotate the barcode 270 degrees clockwise
Format format ImageFormat.Png This is a method that is used for exporting barcode to different type of image formats. It allows developers generate barcode in formats like JPEG/JPG, BMP, GIF, and PNG.

The default method is ImageFormat.Png. Image format type. Using System.Drawing.Imaging.ImageFormat
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 PDF417DataMode.Text The data compaction modes of PDF417 symbology

  • Auto: if set the DataMode as Auto, the PDF417 engine is going to use the appropriate data mode to encode the input data automatically
  • Text: if select the Text mode, the PDF417 engine is able to encode values 9,10,13 & 32-127 of ASCII characters
  • Bytes: the Byte compaction mode is capable of encoding all 256 possible 8-bit byte values of ASCII
  • Numeric: numeric compaction mode encodes numeric data strings only
ECL ecl PDF417ECL.ECL_2 Error Correction Level. PDF417 uses different error correction levels to compensate for defects in the label and misreads in the decoding process. The values of PDF417 error correction levels range from 0 to 8 and the recommended level is 2. Default value is PDF417ECL.ECL_2 (2).
RowCount row-count 3 The number of rows of a PDF417 barcode is selectable. Valid number of rows of a PDF417 symbol ranges from 3 to 90. The default value is 3 rows.
ColumnCount column-count 5 This is the number of columns of a PDF417 symbol. The amount of columns of a PDF417 symbol can be up to 30. The default number is 5 columns. Increase this value if your data size is large.
Truncated truncated false Truncated PDF417, or Compact PDF417, reduces the right hand side of the symbol to improve the symbol density. This option is selected when the barcode is used where space considerations are a primary concern and symbol damage is unlikely.
Macro macro false The Macro PDF417. If a very large amounts of data message need to be encoded into a PDF417 symbol, you can set the Macro property to be true, then Macro PDF417 is enabled.
MacroSegmentIndex macro-segment-index 0 The position of current symbol in the MacroPDF417 sequence. Each barcode in the sequence is assigned a unique segment index, whose number starts from 0 to 99998.
MacroSegmentCount macro-segment-count 0 The number of total symbols which make the sequence.
MacroFileIndex macro-file-index 0 The MacroFileIndex is used to assign a file ID to the MacroPDF. For each related Macro PDF417 symbol, the file ID field contains the same value.

Supported PDF417 Barcode Images for .NET PDF417 Barcoding Component