Hi,
I cannot find a QR barcode from the attached pdf file, using the aspose.barcoderecognition dll.
I'm using all the latest versions of the dlls:
Aspose.Barcode 4.8
Aspose.BarcodeRecognition 4.8
Aspose.Pdf 7.1
Aspose.PdfKit 6.0
My code is:
Sub Main()
Try
activateAspose()
' bind the pdf document
Dim pdfExtractor As New Aspose.Pdf.Facades.PdfExtractor()
pdfExtractor.BindPdf("C:\Users\fgeri\Desktop\test-document.pdf")
' set page range for image extraction
pdfExtractor.StartPage = 1
pdfExtractor.EndPage = 1
' extract the images
Console.WriteLine("Extracting images.....")
pdfExtractor.ExtractImage()
' save images to stream in a loop
Do While pdfExtractor.HasNextImage()
Console.WriteLine("Getting next image....")
' save image to stream
Dim imageStream As New MemoryStream()
pdfExtractor.GetNextImage(imageStream)
imageStream.Position = 0
Console.WriteLine("Recognizing barcode....")
' recognize the barcode from the image stream above
Dim barcodeReader As New Aspose.BarCodeRecognition.BarCodeReader(imageStream, BarCodeReadType.QR)
Do While barcodeReader.Read()
Console.WriteLine("Codetext found: " & barcodeReader.GetCodeText() & ", Symbology: " & barcodeReader.GetReadType().ToString())
Loop
' close the reader
barcodeReader.Close()
Loop
Console.WriteLine("Press any key to terminate")
Console.ReadKey()
Catch ex As Exception
Console.WriteLine(ex.ToString())
End Try
End Sub
Thank you in advance for you support.