KA.Barcode Generator for .NET Suite
How to Create & Resize PDF-417 in C#
Complete C#.NET source code to generate PDF-417 images and adjust barcode size with .NET Control

C# PDF417 barcode generator: create, generate pdf-417 barcode in c# with free example source code



  • Simple to generate, print high-quality PDF-417 matrix images in ASP.NET website, WinForms, Crystal reports
  • Programmatically creating, drawing PDF417 2D barcodes in Visual C#.NET class & console applications
  • Embedding dynamic linear & 2D barcodes, such as Word Interleaved 2 of 5, Codabar .NET WinForms, .NET PDF417, VB.NET ISBN, in your applications
  • Support 2D barcode PDF417 image resizing in cm, inch and pixel units of measure
  • Easily PDF417 barcoding to adjust image X dimension, i.e. width of the module bar for the images
  • Drawing, creating matrix barcodes PDF-417 and customize X to Y ratio to change bar height
  • Easily paint PDF417 and adjust barcode column and row number for size control
  • Support generating & barcoding PDF-417 Truncated for better space efficiency
  • Recongize linear & 2D barcodes using Word barcode or Java barcode
  • Compatible with ISO / IEC 15438 for valid PDF-417 generation and creation
PDF-417 is a bidimensional barcode also known as Portable Data File 417, PDF 417, PDF417 Truncated, Truncated PDF417. KA.Barcode Generator for .NET Suite is the best barcode plugin for .NET Framework, which allows you to print, draw high-quality PDF417 images with proper size in C#.NET class library, ASP.NET web applications and windows forms. In addition, this barcode creator component SDK also provides multiple barcode setting functionality for users to customize generated PDF417 images.
Install KA.Barcode Generator for .NET Suite into C#.NET Project
  1. 1.
  2. 2.
    Add Reference: Add "KeepAutomation.Barcode.Window.dll" to your C#.NET project reference.
How to Generate, Resize PDF417 Barcode Images in C# Class
Copy the following C#.NET Code onto your project to create a PDF417 barcode image
using KeepAutomation.Barcode.Bean;

BarCode pdf417= new BarCode();
pdf417.Symbology = KeepAutomation.Barcode.Symbology.PDF417;
pdf417.CodeToEncode = "417Image";
pdf417.X = 2;
pdf417.generateBarcodeToImageFile("C:/pdf417_csharp.png");

pdf417_image

PDF417 Barcode Unit

Barcode Unit stands for the PDF417 units of measure. KeepAutomation C#.NET PDF417 barcode generator provides three units of measure: Cm, Inch and Pixel. You can make a choice through the following C# code.
pdf417.BarcodeUnit = BarcodeUnit.Pixel;     
Numeric: digits 0 - 9. QR Code Generation in VB.NET. Install QR Code Barcode for .NET Suite into your .NET ....
Suite include complete and strong functionality for high-quality QR Code encoding and printing in types of .NET projects, such as ASP.NET web forms,...
more>

PDF417 X Dimension

The X dimension refers to the width of the narrowest bar, i.e. the module bar, in a generated PDF417 bar code image. Default value is 1 pixel. You can adjust PDF417 module bar width through the following setting.
pdf417.X = 2;

PDF417 X to Y Ratio

You can customize PDF 417 bar height through X to Y Ratio setting, which means the ratio of PDF417 module bar width to module bar height. Default value is 0.33333, the minimum value as is required in the PDF 417 barcode specification. You can adjust this parameter through the C# demo code below. This float value is valid from 0 to 1, with 0.333 being the most popular.
pdf417.PDF417XtoYRatio = 0.333F;

PDF417ColumnCount and PDF417RowCount

A PDF 417 bar code image can be created in various forms if number of rows and columns are adjusted in different ways. Default value is 5 for column number, valid from 1 to 30. Default value for row count is 3 in PDF 417, valid from 3 to 90 inclusive. You can adjust PDF 417 number of rows and columns through the following demo code.
pdf417.PDF417RowCount = 4;
pdf417.PDF417ColumnCount = 5;

PDF 417 BarCode Height and BarCode Width

If you want to generate a PDF 417 bar code image with a fixed size like a specific image width and height, you can use barcode width and barcode height parameters for adjustment. Here is the C#.NET demo code.
pdf417.BarCodeHeight = 70;
pdf417.BarCodeWidth = 175;
Please note that if your encoding data is too long and row number is relatively less than it should be, KeepAutomation Barcode for PDF 417 will generate a valid PDF 417 image with the minimum columns necessary for your encoding data. The generated image width might be larger than the barcode width you have set, so please adjust the width to a larger value.

PDF 417 Margins / Quiet Zones

The ISO/IEC 15438 PDF417 bar code symbology specification requires a horizontal quiet zone/margin with a minimum 2X width as well as the vertical quiet zone. You can adjust the quiet zones through the four parameters: top margin, bottom margin, left margin and right margin. Default value for margin is 0. If you set X = 2, then you should adjust margin to 4.
pdf417.TopMargin = 4;
pdf417.BottomMargin = 4;
pdf417.LeftMargin = 4;
pdf417.RightMargin = 4;

PDF 417 Truncated / Compact PDF417

If the space for the generated PDF417 image is limited, you can simply reduce some of the row overhead to improve PDF 417 symbol density. The reduced version of PDF17 image is Compact PDF417, which was called Truncated PDF417 in earlier specification. To enable this function, just set true to PDF417Truncated property.
pdf417.PDF417Truncated = true;