This example demonstrates how to extract barcodes from a PDF file using specific barcode extraction options.
C#
// Load the PDF file with the Parser class
using (Parser parser = new Parser("input.pdf"))
{
// Confirm barcode extraction is supported
if (!parser.Features.Barcodes)
{
return;
}
// Use barcode options to filter results
BarcodeOptions options = new BarcodeOptions(QualityMode.Low, QualityMode.Low, "QR");
// Retrieve barcode data from the document
IEnumerable<PageBarcodeArea> barcodes = parser.GetBarcodes(options);
// Process the list of extracted barcodes
foreach (PageBarcodeArea barcode in barcodes)
{
Console.WriteLine("Page: " + barcode.Page.Index.ToString());
Console.WriteLine("Value: " + barcode.Value);
}
}