Skip to content

Instantly share code, notes, and snippets.

@GroupDocsGists
Last active May 23, 2023 12:17
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/59f04fc256d7495b92bc88327a376cde to your computer and use it in GitHub Desktop.
Save GroupDocsGists/59f04fc256d7495b92bc88327a376cde to your computer and use it in GitHub Desktop.
Scan Barcode & QR Code using Java
// Scan Barcode using Java
try(Parser parser = new Parser("/path/barcode.png"))
{
// Extract all Barcodes.
Iterable<PageBarcodeArea> barcodes = parser.getBarcodes();
// Iterate
for(PageBarcodeArea barcode : barcodes)
{
// Print the Identified Barcode values
Console.WriteLine(barcode.getCodeTypeName() +" Code Value: " + barcode.getValue());
}
}
// Scan QR Code using Java
try(Parser parser = new Parser("/path/qrcode.png"))
{
// Extract all QR Codes.
Iterable<PageBarcodeArea> barcodes = parser.getBarcodes();
// Iterate
for(PageBarcodeArea barcode : barcodes)
{
// Print the Identified QR Code values
Console.WriteLine(barcode.getCodeTypeName() +" Code Value: " + barcode.getValue());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment