Simple to generate PDF417 in VB.NET web projects & VB.NET WinForms programs
Able to draw & encode PDF417 barcode images to jpeg, gif, png and bitmap files
Provide several Visual Basic methods to output PDF417 barcodes to VB objects
Offer friendly-used developer guide for VB.NET 2D PDF417 barcoding
This guide provides a comprehensive overview of generating PDF-417 barcodes using the BarcodeLib SDK within VB.NET.
PDF-417, also known as Portable Data File 417, is a stacked linear barcode symbology that can encode large amounts of data in a compact form.
It is commonly used in applications such as transportation, identification cards, and inventory management.
The BarcodeLib VB.NET PDF-417 Generator is designed for seamless integration into Windows Forms (WinForms) and Windows Presentation Foundation (WPF) desktop applications, as well as class libraries and console projects.
Introduction of VB.NET PDF417 Barcode Image
PDF417, also known as Portable Data File 417, is a commonly used 2D barcode. It has 9 error correction levels, so it can encode data securely. All PDF417 barcode images generated by this VB.NET Barcode Generator are compatible with latest PDF417 barcode specifications.
Quick to Create PDF-417 Barcodes in VB.NET
Using BarcodeLib VB.NET Barcode Generator library, you can easily generate and print PDF417 2d barcodes in VB.NET application.
Create a new PDF417 object
Enter encoding data to property Data
Call method drawBarcode to print PDF417 barcode to a PNG image file
Note: You can also use drawBarcode method to output barcode in memory to a Stream object, or use drawBarcodeAsBytes() to print PDF417 to a byte array object.
Create, Customize PDF-417 Barcodes in VB.NET
The following VB.NET example consolidates the essential settings for generating a PDF-417 barcode within a class library, Windows Forms, or WPF application. Comments are provided to explain each configuration option.
ImportsBarcodeLib.BarcodeDimbarcodeAsPDF417=NewPDF417' PDF-417 Barcode Basic Settingsbarcode.Data="112233445566"barcode.DataMode=PDF417DataMode.Textbarcode.ECL=PDF417ECL.Level_2barcode.Truncated=Falsebarcode.RowCount=7barcode.ColumnCount=5' Tilde Processing' Set ProcessTilde = True to use "~" for special characters.' Supported formats:' 1-byte character: ~0dd/~1dd/~2dd (value 000-255)' 2-byte (Unicode): ~6ddddd (value 00000-65535)' ECI: ~7dddddd (value 000000-999999)barcode.ProcessTilde=True' Size Settingsbarcode.UOM=UnitOfMeasure.PIXELbarcode.X=3barcode.XtoYRatio=0.3333333Fbarcode.LeftMargin=0barcode.RightMargin=0barcode.TopMargin=0barcode.BottomMargin=0barcode.Resolution=96barcode.Rotate=Rotate.Rotate0' Output Formatbarcode.ImageFormat=System.Drawing.Imaging.ImageFormat.Gif()
' Generate and Savebarcode.drawBarcode("c://pdf-417.gif")
Create PDF-417 Barcode with Data Encoding in VB.NET
Create PDF417 with ASCII characters encoded
Enable property ProcessTilde to true to support ASCII control characters encoding in PDF417 barcode
In property Data, you need convert each control character to its ASCII integer value in the following format: ~ddd. Here ddd is the ASCII value in 3 digits.
Create, Customize PDF-417 with Specified Dimension Size in VB.NET
You can easily print PDF417 barcode with specified image width and height in VB.NET application.
Set property ImageWidth with the specified image width in pixcel
Set property ImageHeight with the specified image height in pixcel
barcode.ImageWidth=600;barcode.ImageHeight=120;
How to create, print PDF417 barcode with options using VB.NET?
PDF-417 Error detection and correction (ECL) in VB.NET
Each PDF-417 symbol contains error correction codewords that enable both error detection and correction. The error correction level can be selected at the time of symbol creation.
The VB.NET barcode library provides the ECL property for this purpose.
The following list shows the number of error correction codewords for each error correction level:
Level 0: 2 codewords
Level 1: 4 codewords
Level 2: 8 codewords
Level 3: 16 codewords
Level 4: 32 codewords
Level 5: 64 codewords
Level 6: 128 codewords
Level 7: 256 codewords
Level 8: 512 codewords
barcode.ECL=PDF417ErrorCorrectionLevel.Level_3
Create Compact (Truncated) PDF417 barcodes using Visual Basic .NET
Compact PDF-417, also known as Truncated PDF-417, omits the right row indicators and some other elements to reduce the symbol size. This variant is suitable when space is limited and symbol damage is unlikely.
To generate a compact PDF-417 using the BarcodeLib VB.NET generator, set the Truncated property to True.
Macro PDF-417 provides a mechanism to split a large data set across multiple PDF-417 symbols. This is similar to Structured Append in other symbologies and is useful when encoding large files or extensive datasets.
Up to 99,999 individual PDF-417 symbols can be used within a single Macro PDF-417 structure.
Enable PDF417 Macro mode by setting the MacroPDF417 property to True.
Assign a unique, consistent MFileID value to all symbols that belong to the same data set.
Specify the total number of symbols using MOptSegmentCount. The valid value is from 1 to 99999.
Set the current symbol's sequence index using MSegmentIndex. The first symbol should use index 0.
Dimbarcode=NewPDF417()
barcode.Data="Macro PDF-417"barcode.MacroPDF417=True'Each int must be in range [0, 899]barcode.MFileID=NewInteger() {100, 200}
'Valid range: 0 ~ 99998barcode.MSegmentIndex=0'Valid: 1 ~ 99999barcode.MOptSegmentCount=3barcode.drawBarcode("C://Output//vb-net-pdf417-macro-demo.png")
Note: All symbols sharing the same data message must use the same MFileID value. Ensure MSegmentIndex values are correctly ordered to allow proper reconstruction when scanning.
Guide to Create PDF-417 Images in VB.NET ASP.NET Web Applications
Add Barcodelib.Barcode.ASP.NET.dll to your web project.
Add Barcodelib.Barcode.ASP.NET.dll to the Toolbox.
Find the folder barcode in the trial package and copy files "pdf417.aspx", "pdf417.aspx" to your web project folder.
Drag PDF417ASPNET from the Toolbox and drop it on your web project. Then you will see a PDF417 barcode image.
Adjust the settings in the Properties Window or generate it with above free VB.NET code.
Guide to Generate PDF-417 Barcodes in VB.NET Windows Forms Projects
Add BarcodeLib.Barcode.WinForms.dll to your Windows Forms project.
Add BarcodeLib.Barcode.WinForms.dll to the Toolbox.
Drag PDF417WinForm to your windows form and you will see a PDF417 barcode image. Click the image and adjust its parameters in the Properties Window or you can create a PDF417 barcode with above VB free sample codes.
Summary
This guide has provided a detailed walkthrough for generating PDF-417 barcodes using the BarcodeLib SDK in VB.NET. The library supports essential features such as error correction level selection, compact (truncated) symbols for space constrained environments, and Macro PDF-417 for splitting data across multiple barcodes.
These capabilities are well suited for integration into Windows Forms (WinForms) and Windows Presentation Foundation (WPF) desktop applications, as well as other .NET project types. By following the examples and explanations provided, you can confidently incorporate PDF-417 generation into your VB.NET projects.