GroupDocs.Parser .Net allows to scan QR Code from PDF, MS Word (DOC, DOCX), MS PowerPoint (PPT, PPTX), LibreOffice formats and many others (see full list at supported document formats article).
GroupDocs.Parser’s QR Code scanner is easy to use and powerful at the same time. Our sophisticated algorithms allow to read even damaged barcodes.
This article demonstrates how to implement QR Code reader from any supported format.
How to scan QR Code in .Net with GroupDocs.Parser
To scan QR Code from your file, simply call GetBarcodes method:
IEnumerable<PageBarcodeArea>GetBarcodes();
This method returns a collection of PageBarcodeArea objects.
Here are the steps to extract a QR Code from file:
Iterate through the collection and get a barcode value.
The following example shows how to scan barcode:
// Create an instance of Parser classusing(Parserparser=newParser(Constants.SamplePdfWithBarcodes)){// Check if the file supports barcodes extractionif(!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 barcodesforeach(PageBarcodeAreaqrcodeinqrcodes){// Print the page indexConsole.WriteLine("Page: "+qrcode.Page.Index.ToString());// Print the qrcode valueConsole.WriteLine("Value: "+qrcode.Value);}}