Free Support Forum -

Qr code from pdf is not recognized

for a new project i want to test aspose.barcode. but unfortunately only 50% of the QR code is recognized. am i doing something wrong? Or why are the QR codes not recognized?

using Aspose.BarCode;
using Aspose.BarCode.BarCodeRecognition;
using Aspose.BarCode.ComplexBarcode;
using Aspose.Pdf;

using Aspose.Pdf.Devices;
using System;
using System.Drawing.Imaging;
using System.IO;

namespace ConsoleApp11
class Program
// PDF Path import
public const string dataDirPDF = “C:\Daten\Aspose\”;

    static void Main(string[] args)
        // List all PDF's in Folder
        DirectoryInfo d = new DirectoryInfo(@dataDirPDF);
        FileInfo[] Files = d.GetFiles("*.pdf"); 
        foreach (FileInfo file in Files)
            // Create PNG from PDF
    static void ReadQRCode(string filename)
        Aspose.BarCode.License license = new Aspose.BarCode.License();


            // Bind the pdf document
            Aspose.Pdf.Facades.PdfExtractor pdfExtractor = new Aspose.Pdf.Facades.PdfExtractor();
            // Extract the images

            // Save images to stream in a loop
            while (pdfExtractor.HasNextImage())
                // Save image to stream
                MemoryStream imageStream = new MemoryStream();
                imageStream.Position = 0;
                int found = 0;

                // Recognize the barcode from the image stream above
                using (BarCodeReader reader = new BarCodeReader(imageStream, DecodeType.QR))
                    foreach (BarCodeResult barcodeResult in reader.ReadBarCodes())
                        found = 1;
                        var result = barcodeResult.CodeText.Split(new string[] { "\n" }, StringSplitOptions.None);

                        Console.WriteLine("Zeile 3 " + result[3]);
                        Console.WriteLine("Zeile 28 " + result[28]);
                if (found == 0) {
                    Console.WriteLine("no QR Found");

        catch (Exception ex)



for example this qr code is not recognized
qr-factsheet.pdf (133.6 KB)


Please notice, I am able to reproduce the issue as you mentioned using your template file and sample code. I found QR code is not recognized by Aspose.BarCode for .NET recognition engine. I have logged a ticket with an id " BARCODENET-37754" for your issue. We will look into it soon.

Once we have an update on it, we will let you know.

Thanks for the quick reply


You are welcome.