Skip to content

Instantly share code, notes, and snippets.

@GroupDocsGists
Last active May 23, 2023 12:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GroupDocsGists/8a976795306627a305e479a3480ecd32 to your computer and use it in GitHub Desktop.
Save GroupDocsGists/8a976795306627a305e479a3480ecd32 to your computer and use it in GitHub Desktop.
Scan Barcode & QR Code using C#
// Scan Barcode using C#
using (Parser parser = new Parser("/path/barcode.png"))
{
// Extract all Barcodes.
IEnumerable<PageBarcodeArea> barcodes = parser.GetBarcodes();
// Iterate over Barcodes
foreach (PageBarcodeArea barcode in barcodes)
{
// Print the Identified Barcode values
Console.WriteLine(barcode.CodeTypeName +" Value: " + barcode.Value);
}
}
// Scan QR Code using C#
using (Parser parser = new Parser("/path/qrcode.png"))
{
// Extract all QR Codes.
IEnumerable<PageBarcodeArea> barcodes = parser.GetBarcodes();
// Iterate
foreach (PageBarcodeArea barcode in barcodes)
{
// Print the Identified QR Code values
Console.WriteLine(barcode.CodeTypeName +" Code Value: " + barcode.Value);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment