Iterate through the collection and get a barcode value.
The following example shows how to extract barcodes from a document:
// Create an instance of Parser classusing(Parserparser=newParser(Constants.SamplePdfWithBarcodes)){// Check if the document supports barcodes extractionif(!parser.Features.Barcodes){Console.WriteLine("Document doesn't support barcodes extraction.");return;}// Extract barcodes from the document.IEnumerable<PageBarcodeArea>barcodes=parser.GetBarcodes();// Iterate over barcodesforeach(PageBarcodeAreabarcodeinbarcodes){// Print the page indexConsole.WriteLine("Page: "+barcode.Page.Index.ToString());// Print the barcode valueConsole.WriteLine("Value: "+barcode.Value);}}
More resources
GitHub examples
You may easily run the code above and see the feature in action in our GitHub examples:
Along with full featured .NET library we provide simple, but powerfull free APPs.
You are welcome to scan barcode from your files or mobile phone camera with our free online GroupDocs Scanner App which is build with GroupDocs.Parser .Net.
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.