VB.NET PDF-417 Generator Introduction
PDF-417, also known as Portable Data File 417, PDF 417, PDF417 Truncated, is a stacked linear barcode symbol format used in a variety of applications.
Using VB.NET PDF-417 Generator to create PDF-417 barcodes in VB.NET program is a simple and easy job. VB.NET PDF-417 Generator control is easy to install with a single .NET Barcode generation control. It is easy to generate PDF-417 barcodes in VB.NET class with detailed VB.NET PDF-417 settings document and complete demo for PDF-417 generation in VB.NET provided in this article.
PDF-417 Generators
OnBarcode provides several PDF-417 Generator components and software, including .NET PDF-417, Java PDF-417, C# PDF-417, Android PDF-417 Generator, PDF-417 Generator, ASP.NET PDF-417.
Create PDF-417 Barcodes in VB.NET
Creating PDF-417 barcode in VB.NET class example:
Imports OnBarcode.Barcode
Dim barcode As PDF417 = New PDF417
' PDF-417 Barcode Basic Settings
barcode.Data = "112233445566"
barcode.DataMode = PDF417DataMode.Text
barcode.ECL = PDF417ECL.Level_2
barcode.Truncated = False
barcode.RowCount = 7
barcode.ColumnCount = 5
' Set the ProcessTilde property to true, if you want use the tilde character "~"
' to specify special characters in the input data. Default is false.
'
' 1) 1-byte character: ~0dd/~1dd/~2dd (character value from 000 ~ 255);
' ASCII character '~' is presented by ~126;Strings from "~256" to "~299" are unused
' modified to FS, GS, RS and US respectively.
' 2) 2-byte character (Unicode): ~6ddddd (character value from 00000 ~ 65535)
' Strings from "~665536" to "~699999" are unused
' 3) ECI: ~7dddddd (valid value of dddddd from 000000 to 999999)
barcode.ProcessTilde = True
' Barcode Size Related Settings
barcode.UOM = UnitOfMeasure.PIXEL
barcode.X = 3
barcode.XtoYRatio = 0.3333333F
barcode.LeftMargin = 0
barcode.RightMargin = 0
barcode.TopMargin = 0
barcode.BottomMargin = 0
barcode.Resolution = 96
barcode.Rotate = Rotate.Rotate0
' Image format setting
barcode.ImageFormat = System.Drawing.Imaging.ImageFormat.Gif()
barcode.drawBarcode("c://pdf-417.gif")
How to create, encode text string in PDF417 using VB.NET?
Encode ASCII characters in PDF-417 using VB.NET
The VB.NET code snippet below creates a PDF417 2D barcode with ASCII control character support for Windows Forms and WPF desktop applications.
It initializes a
It initializes a
PDF417 barcode object, enables tilde processing for special character (ASCII control character) encoding, sets data with an ASCII control sequence, and encodes and prints the finished barcode as a PNG image file.
- Enable the tilde character processing feature of the PDF417 encoder to recognize special control sequences.
- Assign a data string containing standard text and an ASCII control character sequence (
~013) to the barcodeDataproperty.
The ~013 value represents an ASCII carriage return control character, processed only when tilde processing is enabled in VB.NET.
Dim barcode = New PDF417() barcode.ProcessTilde = True barcode.Data = "PDF417~013abc" barcode.drawBarcode("C://Output//vb-net-pdf417-ascii-control-char.png")
Encode Unicode text in PDF-417 using VB.NET
Here we will explain how to generate a PDF417 2D barcode with Unicode multi-language text encoded in VB.NET Windows Forms and WPF desktop applications.
- Enable the built-in Unicode text encoding feature of the PDF417 barcode library for VB.NET desktop applications.
This property
EncodeUnicodeTextensures proper encoding of multi-byte Unicode characters (such as Japanese, Chinese) in the PDF417 barcode. - Assign a mixed Unicode text string (Chinese characters and English) to the barcode's data property for encoding.
Dim barcode = New PDF417() barcode.EncodeUnicodeText = True barcode.Data = "你好 hello in Chinese" barcode.drawBarcode("C://Output//vb-net-pdf417-unicode-text.png")
How to create, customize PDF-417 barcode dimension size using VB.NET?
Here we will demonstrate how to create and customize a PDF417 with specified diemsnion size using VB.NET.
The vb.net example below initializes a PDF417 barcode object, disables automatic resizing, configures precise pixel-based dimensions, module sizes, aspect ratio, resolution, column/row counts, zero margins, and exports the fully customized barcode as a high-resolution PNG image.
The vb.net example below initializes a PDF417 barcode object, disables automatic resizing, configures precise pixel-based dimensions, module sizes, aspect ratio, resolution, column/row counts, zero margins, and exports the fully customized barcode as a high-resolution PNG image.
Dim barcode = New PDF417() barcode.Data = "PDF-417" barcode.AutoResize = False barcode.UOM = UnitOfMeasure.PIXEL barcode.X = 5 barcode.XtoYRatio = 0.3333F barcode.Resolution = 300 barcode.ColumnCount = 5 barcode.RowCount = 12 barcode.LeftMargin = 0 barcode.RightMargin = 0 barcode.TopMargin = 0 barcode.BottomMargin = 0 barcode.drawBarcode("C://Output//vb-net-pdf417-size-customization.png")
How to create, print PDF417 barcode with options using VB.NET?
PDF-417 Error detection and correction (ECL) in VB.NET
Each PDF417 symbol contains at least two error correction codewords. The Error Correction codewords
provide capability for both error detection and correction.
The error correction level for a PDF417 symbol is selectable at the time of symbol creation. The VB.NET barcode software provides property "ECL". The following table shows the number of error correction codewords for each error correction level.
The error correction level for a PDF417 symbol is selectable at the time of symbol creation. The VB.NET barcode software provides property "ECL". The following table shows the number of error correction codewords for each error correction level.
| Error Correction Level | Total Number of Error Correction Codewords |
| 0 | 2 |
| 1 | 4 |
| 2 | 8 |
| 3 | 16 |
| 4 | 32 |
| 5 | 64 |
| 6 | 128 |
| 7 | 256 |
| 8 | 512 |
Create Compact (Truncated) PDF417 barcodes using Visual Basic .NET
Compact PDF417 is also named as Truncated PDF417. In the original AIM USA (1994) and AIM Europe (1994) PDF417 specifications,
the term Truncated PDF417 has been used in a technically synonymous manner.
Compact PDF417 may be used where space considerations are a primary concern and symbol damage is unlikely.
To create compact PDF417 using PDF417 generator VB.NET library, you need set property Truncated to true;
Compact PDF417 may be used where space considerations are a primary concern and symbol damage is unlikely.
To create compact PDF417 using PDF417 generator VB.NET library, you need set property Truncated to true;
Dim barcode = New PDF417() barcode.Data = "PDF-417" barcode.Truncated = True barcode.drawBarcode("C://Output//vb-net-pdf417-compact-demo.png")
Create Macro PDF417 barcodes in VB.NET
Macro PDF417 provides a mechanism for the data in a file to be split into blocks and be represented in more
than one PDF417 symbol. This mechanism is similar to the Structured Append feature in other symbologies.
Up to 99 999 individual PDF417 symbols may be used to encode data in Macro PDF417.
Up to 99 999 individual PDF417 symbols may be used to encode data in Macro PDF417.
- Set property
Macroto true to enable Macro PDF417 barcode generation in vb.net - Set property
MacroFileIndexto a random unique integer. All PDF417 barcodes to store the same data message should have the same MacroFileIndex value. - Set property
MacroSegmentCountto specify the number of PDF417 barcodes to hold the same text message - Set property
MacroSegmentIndexto specify the order of the current PDF417. It starts with 0.
Dim barcode = New PDF417() barcode.Data = "Macro PDF-417" barcode.Macro = True barcode.MacroFileIndex = 3 barcode.MacroSegmentCount = 10 barcode.MacroSegmentIndex = 2 barcode.drawBarcode("C://Output//vb-net-pdf417-macro-demo.png")
Common Asked Questions
What is PDF417 used for?
PDF417 is a high density, 2-dimensional stacked barcode symbology used in a variety of industries and applications, such as driver's license, airline boarding pass, transport, and inventory management.
Using VB.NET Barcode Generator library, you can quickly encode, create and print PDF417 barcode images in Visual Basic .NET class library, console, WinForms, WPF windows applications.
What is the maximum capacity of a PDF417?
The maximum number of characters encodable in a PDF417 barcode at lowest error correction level (0).
- Text Compaction mode: 1,850 characters
- Byte Compaction mode: 1,108 characters
- Numeric Compaction mode: 2,710 characters
PDF417.M_AUTO value to PDF417.setDataMode() method, the VB.NET barcode library will automatically
analyze the PDF417 encoding text characters and choose the right PDF417 data modes in Visual Basic .NET class library, console, WinForms, WPF windows applications.
What is the aspect ratio of a PDF417?
The aspect ratio of the printed PDF417 barcode shall be defined by two dimensions:
setX(): set the dimension of the narrowest bar and narrowest space. Using VB.NET barcode library, you can customize X value through methodPDF417.setX()setXtoYRatio(): the ratio of bar width vs bar height. Using VB.NET barcode library, you can customize it through methodPDF417.setXtoYRatio()
What is the difference between a PDF417 and a QR Code?
PDF417 and QR Code are both 2D or matrix barcode symbologies. PDF417 can be scannable even if up to 50% of it is damaged. QR Code can accept up to 30% damages.
VB.NET Barcode library supports both PDF417 and QR Code 2d barcode generations.
In VB.NET class, you can create and initiate a
In VB.NET class, you can create and initiate a
PDF417 object to generate PDF417 barcode images,
and initiate a QRCode object to draw QR Code images in Visual Basic .NET class library, console, WinForms, WPF windows applications.