GroupDocs.Parser for .NET 24.4 Release Notes
Full List of Issues Covering all Changes in this Release
Key | Summary | Category |
---|---|---|
PARSERNET-2306 | Implement the ability to customize recognition quality options of barcode scanning | Feature |
PARSERNET-2307 | Implement the ability to read damaged and distorted barcode | Feature |
Public API and Backward Incompatible Changes
Ability to customize recognition quality options of barcode scanning
Description
This feature allows to customize the image and barcode quality to tune the barcode parsing speed and accuracy.
Public API changes
Parser public class was updated with changes as follows:
GetBarcodes(PageAreaOptions) and GetBarcodes(int, PageAreaOptions) methods were marked as Obsolete;
Added GetBarcodes(BarcodeOptions) method;
Added GetBarcodes(int, BarcodeOptions) method.
PageBarcodeArea public class was updated with changes as follows:
PageBarcodeArea(string, string, Page, Rectangle) consturctor was marked as Obsolete;
Added PageBarcodeArea(string, string, int, double, Page, Rectangle) constructor;
Added Confidence property;
Added Angle property.
BarcodeOptions public class was added.
QualityMode public enum was added.
Usage
The following example shows how to extract barcodes with additional options from a document:
// Create an instance of Parser class
using (Parser parser = new Parser(Constants.SamplePdfWithBarcodes))
{
// Check if the document supports barcodes extraction
if (!parser.Features.Barcodes)
{
Console.WriteLine("Document doesn't support barcodes extraction.");
return;
}
// Create the options which are used for barcodes extraction
BarcodeOptions options = new BarcodeOptions(QualityMode.Low, QualityMode.Low, "QR");
// Extract barcodes from the document.
IEnumerable<PageBarcodeArea> barcodes = parser.GetBarcodes(options);
// Iterate over barcodes
foreach (PageBarcodeArea barcode in barcodes)
{
// Print the page index
Console.WriteLine("Page: " + barcode.Page.Index.ToString());
// Print the barcode value
Console.WriteLine("Value: " + barcode.Value);
}
}
Ability to customize recognition quality options of barcode scanning
Description
This feature allows to read damaged and distorted barcodes.
Usage
The following example shows how to extract corrupted barcodes from a document:
// Create an instance of Parser class
using (Parser parser = new Parser(Constants.SampleCorruptedBarcodes))
{
// Check if the document supports barcodes extraction
if (!parser.Features.Barcodes)
{
Console.WriteLine("Document doesn't support barcodes extraction.");
return;
}
// Create the options which are used for barcodes extraction
// The full constructor is used to set AllowIncorrectBarcodes property
BarcodeOptions options = new BarcodeOptions(null, QualityMode.Low, QualityMode.Low, null, true, "pdf417", "QR");
// Extract barcodes from the document.
IEnumerable<PageBarcodeArea> barcodes = parser.GetBarcodes(options);
// Iterate over barcodes
foreach (PageBarcodeArea barcode in barcodes)
{
// Print the page index
Console.WriteLine("Page: " + barcode.Page.Index.ToString());
// Print the barcode value
Console.WriteLine("Value: " + barcode.Value);
// Print the confidence:
Console.WriteLine("Confidence: " + barcode.Confidence.ToString());
}
}