Using this C# demo code, all the barcode images in file "pdf417-csharp.gif" will be scanned.
How to Use Special Functions to Read C# PDF-417 2D Barcode Image
BarcodeLib.com C#.NET Barcode Decoder can be used to recognize PDF-417 barcode images for .NET, ASP.NET Web, Windows, C#, VB.NET Class Library applications. To fulfill different requirements, we design some special barcode recognition methods.
1. Scan the Maximum One PDF-417 Barcode from a Large Size Image Source
To do so, you need to adjust the property maxOneBarcodePerPage to "true".
In this case, our PDF-417 C#.NET Barcode Decoder Library will stop scanning the barcode when it detects one PDF-417 barcode.
If not "true", our PDF-417 C#.NET Barcode Decoder Library will use total 5 algorithms and each will read the whole source file from 4 directions.
2. Scan a Specific Part of the Source Image File Where the PDF-417 Barcode Is Located
If your PDF-417 barcode image is always at specific area on the image file, you may set PDF-417 .NET Barcode Reader SDK to scan that area only. And this saves a lot of reading time, CPU and memory usage.
As for the specific are, you can just demonstrate the left top point and right bottom point of the area (the point X, Y values are expressed in percentage of the whole image, so image most left top point is (0%, 0%), and most right bottom point is (100%, 100%)).
Please use the following example to scan your PDF-417 barcocde on source image specific area, and we take top 20% and bottom 20% of a sample image file "pdf417-csharp.gif" as an example.
OptimizeSetting setting = new OptimizeSetting();
ScanArea top20 = new ScanArea(new PointF(0.0F, 0.0F), new PointF(100.0F, 20.0F));
ScanArea bottom20 = new ScanArea(new PointF(0.0F, 80.0F), new PointF(100.0F, 100.0F));
List<ScanArea> areas = new List<ScanArea>(); areas.Add(top20); areas.Add(bottom20);