VB.NET PDF-417 Generator Size Setting Tutorial

sample source code to generate 2D PDF-417 images and adjust barcode size in VB.NET

  • Set width and height of PDF-417 module bar
  • Capable of printing PDF-417 in a fixed image size
  • Generate truncated PDF-417 to save space
  • Flexible to set the count of rows and columns in a PDF-417
  • Easy to change the angle of the image
  • Support creating PDF-417 with Gif, Tiff, BMP, PNG, and Jpeg
  • Compatible with ISO / IEC 15438 (2nd edition 2006-06-01)

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.

How to generate, print barcode using .NET, Java sdk library control with example project source code free download:

PDF-417 Symbology Structure

W : the width of PDF-417, controlled by property BarCodeWidth

H : the height of symbol, controlled by property BarCodeHeight

X (X ≥ 1 pixel): the width of a module bar, controlled by property X

Y (Y ≥ 3X): height of a row, controlled by property Y

R (3 ≤ R ≤ 90): the number of rows in PDF-417, controlled by property RowCount

C (1 ≤ C ≤ 30): the number of columns, excluding start, stop and row indicator codewords, controlled by property ColumnCount

Q (Q ≥ 2X): the width of the quiet zone, controlled by property LeftMargin & RightMargin

More information about PDF-417 barcode settings in Excel Barcode Generator,please see:


PDF-417 VB.NET Generator Size Setting Tutorial

After PDF-417 VB.NET Generator installation, get it ready in VB.NET by placing the following statement:

Dim pdf417 As OnBarcode.Barcode. PDF417

pdf417 = New OnBarcode.Barcode. PDF417


Property XtoYRatio (Type: Float; Default: 0.3333333) is used in PDF-417 to set the module height of PDF-417 bars. The height of module is the product of X and XtoYRatio.

Sample usage:

pdf417. XtoYRatio = 0.5;

ColumnCount & RowCount

pdf417.ColumnCount = 3

pdf417.RowCount = 3


Truncated PDF-417 may be used where space is limited for the symbol. Set Property Truncated (Type: bool; Default: False) to be true when truncated PDF-417 is need.

Sample usage:

pdf417.Truncated = True


UOM is the controller of size setting unit. Pixel, Cm, and Inch are provided as its options. The default value of UOM is Pixel. For example, type the following statement to select Pixel as the unit of size setting measure:

pdf417.UOM = OnBarcode.Barcode.UnitOfMeasure.PIXEL


Property X (Type: Type: Float; Default: 1) is used for the module width setting.

Sample usage:

pdf417.X = 2

BarCodeHeight & BarCodeWidth

Property BarCodeHeight (Type: Float; Default: 0) and Property BarCodeWidth (Type: Float; Default: 0) to set the size of the whole image.

Sample usage:

pdf417.BarcodeHeight = 175

pdf417.BarcodeWidth = 175


When the value of X, BarCodeWidth, and BarCodeHeight conflict with each other, Property AutoResize (Type: bool; Default: False) should be enabled to solve the problem and make the PDF-417 100% compatible with its symbology specification and ISO 15438. See PDF-417 Barcode Size in VB.NET to know more usage of AutoResize.

Sample usage:

pdf417.X = 2

pdf417.BarcodeHeight = 60

pdf417.AutoResize = True

TopMargin, BottomMargin, LeftMargin, & RightMargin

Using PDF-417 VB.NET Generator, a quiet zone with 10X width will be generated automatically at each side of the PDF-417. When wider quiet zone is needed, you can increase the value of properties LeftMargin (Type: Float; Default: 0) and RightMargin (Type: Float; Default: 0). You can also create margins using TopMargin (Type: Float; Default: 0) and BottomMargin (Type: Float; Default: 0).

Sample usage:

pdf417.TopMargin = 10

pdf417.BottomMargin = 10

pdf417.LeftMargin = 10

pdf417.RightMargin = 10

OnBarcode is a market-leading provider of barcode imaging generator, reader controls and components for ASP.NET, Windows Forms, WPF, as well Java, Android, iOS (iPhone, iPad) across all major enterprise development platforms. We provides comprehensive tutorials and how-tos for various linear, 2d barcode information, such as C# in ASP.NET, C# .NET, C# Barcode Encoding, C# Barcode Image, VB.NET in ASP.NET, VB.NET Winforms, VB.NET Barcode Encoding. OnBarcode barcode products are supported by RasterEdge ASP.NET Document Viewer, which supports ASP.NET PDF Viewer, ASP.NET MVC Document Viewer, ASP.NET PDF Editor, MVC PDF Viewer. And provide high quality C# Convert PDF to Tiff, C# Convert PDF to Word, C# Convert PDF to HTML, C# Convert PDF to Jpeg images, and their easy and simple documents, like C# PDF SDK, C# extract text from PDF, C# Compress PDF, Print PDF in C# and C# extract image from PDF.
Terms of Use | Privacy Policy
Copyright © OnBarcode.com . All rights reserved.