Skip to content

Instantly share code, notes, and snippets.

@conholdate-docs-gists
Created October 21, 2022 16:02
Show Gist options
  • Save conholdate-docs-gists/28590d7ad4bf27705a682483810228b5 to your computer and use it in GitHub Desktop.
Save conholdate-docs-gists/28590d7ad4bf27705a682483810228b5 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 with type "QR" from your file.
IEnumerable<PageBarcodeArea> qrcodes = parser.GetBarcodes().Where(i => i.CodeTypeName == "QR");
// Iterate over barcodes
foreach (PageBarcodeArea qrcode in qrcodes)
{
// Print the page index
Console.WriteLine("Page: " + qrcode.Page.Index.ToString());
// Print the qrcode value
Console.WriteLine("Value: " + qrcode.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