Iterate through the collection and get a barcode value.
The following example shows how to extract barcodes from the upper-right corner:
// 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;}// Create the options which are used for barcodes extractionBarcodeOptionsoptions=newBarcodeOptions(newRectangle(newPoint(590,80),newSize(150,150)));// Extract barcodes from the upper-right corner.IEnumerable<PageBarcodeArea>barcodes=parser.GetBarcodes(options);// 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.