Skip to content

Instantly share code, notes, and snippets.

@conholdate-docs-gists
Created October 21, 2022 15:44
Show Gist options
  • Save conholdate-docs-gists/63ee67bbcee0453c7ff2c3dba12ac3a5 to your computer and use it in GitHub Desktop.
Save conholdate-docs-gists/63ee67bbcee0453c7ff2c3dba12ac3a5 to your computer and use it in GitHub Desktop.
// Create an instance of Parser class
using (Parser parser = new Parser(Constants.SamplePdfWithBarcodes))
{
// Check if the file supports barcodes extraction
if (!parser.Features.Barcodes)
{
Console.WriteLine("The file doesn't support barcodes extraction.");
return;
}
// Scan barcodes from the file.
IEnumerable<PageBarcodeArea> barcodes = parser.GetBarcodes();
// 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);
}
}
@conholdate-docs-gists
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment