FAQ TBarCode .NET
How Can I Optimize PDF417 Symbols in my ASP.NET Web Control?
How Can I Optimize PDF417 Symbols in my ASP.NET Web Control?
Option #1
Add the following attributes to your TBarCode .NET Web Control. This will generate an optimized symbol, which fits into a 120 x 120 pixel matrix. Increase both the Width/Height and the NumberOfColumns attribute if required.
<cc2:BarcodeControl id="BarcodeControl1" Width="120" Height="120" Barcode-Dpi="96" Barcode-SizeMode="MinimalModuleWidth" Barcode-Pdf417-NumberOfColumns="3" Barcode-MustFit="True" ErrorHandling="ShowMessage" Barcode-BarcodeType="Pdf417"
Option #2
In the Page Load event or after you have set the bar code data apply the following calculation. This code will use width/height ratio of 1:3 for the graphical modules.
Barcode barcode = BarcodeControl1.Barcode; barcode.SizeMode = SizeMode.FitToBoundingRectangle; System.Drawing.Size optimalSize = barcode.CalculateOptimalBitmapSize(null, 1, 1); BarcodeControl1.Width = new Unit(optimalSize.Width, UnitType.Pixel); BarcodeControl1.Height = new Unit(optimalSize.Height, UnitType.Pixel); BarcodeControl1.Refresh();