KA.Barcode for .NET WinForms
How to Generate PDF-417 Image in .NET WinForms
Source code to generate, print PDF417 in different image formats using Barcode for .NET WinForms
  • Easy-to-use PDF-417 Control completely written in managed C# with full integration for .NET
  • Dynamically create, make matrix PDF-417 bar codes in .NET Windows Forms and Crystal Reports
  • Support generating Compact PDF-417 (Truncated PDF-417) in C#, VB.NET programming
  • 4 levels of PDF-417 Error Correction Level to protect data from damage
  • Simple to adjust 2D PDF-417 row number and column number
  • Powerful barcode component barcode Word, Java barcode, barcode .NET developed for easy barcode creation
  • Print multiple matrix PDF-417 and save generated barcodes as gif, jpeg, png, tiff, and bitmap files
  • Compatible with ISO / IEC 15438 (2nd edition) for valid image output
  • ISBN Excel, Codabar Java, Intelligent Mail Java, ASP.NET Data Matrix and other linear & 2D barcode control provided
  • Support producing accurate PDF-417 barcode with outstanding quality even on thermal printers
PDF-417 is also named Portable Data File 417, PDF 417, PDF417 Truncated. With KA.Barcode Generator for .NET WinForms, a high-quality barcode API software device, you can simply generate PDF-417 in WinForms, C#, Visual Basic.NET, and save barcodes in Png, Jpg, Gif, Tiff, Bmp image formats. Users are also able to customize the resolution, orientation, DPI, margins etc for he generated barcode picture on the intuitive interface.
Here are two more tutorials with details.
PDF-417 Image Setting in .NET Windows Forms

Install PDF417 Barcode Maker into .NET

  1. 1.
  2. 2.
    Add reference: Add "KeepAutomation.Barcode.Windows.dll" to your .NET Winforms project reference
  3. 3.
    Add to toolbox: To add BarcodeControl to your .NET Winforms toolbox

Drag & Drop PDF-417 BarcodeControl to Adjust Image

  1. 1.
    In "Choose Toolbox Items" form, click button "Browse...", and select KeepAutomation.Barcode.Windows.dll.
  2. 2.
    Now you will see BarCodeControl in your toolbox.
  3. 3.
    Drag and drop the BarCodeControl into the Forms and a Codabar image is generated.
  4. 4.
    Find barcode setting panel in the left side and change barcode symbology into PDF417.
  5. 5.
    Now you can customize the following setting.


The X dimension is the width of the narrowest bar in a generated PDF 417 barcode image. The Y dimension is the height of each row in a PDF417 barcode symbol, i.e. the module bar height. The parameter of XtoYRatio is valid from 0.2 to 0.5 inclusive, with 0.3 being the most common value. Default value is 0.3333 for KA.Barcode for .NET WinForms PDF417 XtoYRatio

PDF417 Barcode Margins

Margins are called quiet zones in the barcode specification. The ISO/IEC 15438 specification for PDF417 requires margins on four sides of a PDF417 image with twice the value of X dimension.

PDF417 Image Formats

KA.Barcode Generator for .NET Suite supports printing and saving PDF417 barcodes in different image formats, including Png, Jpeg/Jpg, Gif, Tiff, Bmp, etc. You can select proper image formats to save PDF 417 barcodes.

PDF417 Barcode Unit

KA.Barcode Generator for .NET Suite provides three units of measure for PDF417 image generation: Pixel, Cm and Inch. The default value is Pixel. Select proper BarcodeUnit in the right side property panel.

PDF417 Image Resolution

KA.Barcode Generator for .NET Suite is designed to help you print high-quality barcode images in C#.NET. You can customize image resolution through DPI, which is short for Dots per Inch. 72 DPI is the default value for the generated PDF417 barcode images.

PDF417 Image Orientation

For rotating PDF 417 image, i.e. the barcode rotation angle, developers can select from four types of orientation four types of barcode orientations: 0 degree, 90 degrees, 180 degrees, and 270 degrees. Default value is 0 degree.
PDF417 Image Setting in C#.NET & VB.NET Class Library
Follow the sample barcode printing program below to produce, display a PDF-417 in Windows Forms:
BarCode pdf417 = new BarCode(); 
pdf417. Symbology = Symbology.PDF417;
pdf417.CodeToEncode = "CODE39";
pdf417.BarcodeUnit = KeepAutomation.Barcode.BarcodeUnit .Pixel;
pdf417.DPI = 72;
pdf417.X =2;
pdf417.LeftMargin = 6;
pdf417.RightMargin = 6;
pdf417.TopMargin = 6;
pdf417.BottomMargin = 6;
pdf417.PDF417XtoYRatio = 0.3;
pdf417.PDF417ColumnCount = 3;
pdf417.PDF417RowCount = 5;
pdf417.PDF417Truncated = true;
pdf417.Orientation = KeepAutomation.Barcode.Orientation .Degree90;
pdf417.ImageFormat = System.Drawing.Imaging.ImageFormat.Png;
Dim pdf417 As KeepAutomation.Barcode.Bean.BarCode = New KeepAutomation.Barcode.Bean.BarCode

pdf417.Symbology = KeepAutomation.Barcode.Symbology.PDF417
pdf417.BarcodeUnit = KeepAutomation.Barcode.BarcodeUnit.Pixel
pdf417.DPI = 72
pdf417.CodeToEncode = "417Data"
pdf417.X = 3
pdf417.LeftMargin = 6
pdf417.RightMargin = 6
pdf417.TopMargin = 6
pdf417.PDF417XtoYRatio = 0.3;
pdf417.PDF417ColumnCount = 3
pdf417.PDF417RowCount = 5
pdf417.PDF417Truncated = true
pdf417.Orientation = KeepAutomation.Barcode.Orientation.Degree90
pdf417.ImageFormat = System.Drawing.Imaging.ImageFormat.Png()
pdf417.generateBarcodeToImageFile("C://code39 _vb.png")