We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Problem with BarcodeReader.Timeout

I’m trying to read all barcode Code93Extended in a PDF.
My method works fine with a lot of PDF but I Have a problem with 2 files.
Calling “barcodeReader.Read()” stucks, Method doesn’t return. My application hangs on this method.
I set Timeout (in milliseconds) but doesn’t work.
I use Aspose.Barcode 5.0 (I can’t upgrade it).

Help me please. Thanks!

Private Function GetBarcodePDF() As List(Of String)
Dim listCodes = New List(Of String)
’ Set Licence…

        ' bind the pdf document
        Dim pdfExtractor As Aspose.Pdf.Facades.PdfExtractor = New Aspose.Pdf.Facades.PdfExtractor()

        ' set page range for image extraction
        pdfExtractor.StartPage = 0
        pdfExtractor.EndPage = 1

        ' extract the images

        ' save images to stream in a loop
        Do While pdfExtractor.HasNextImage()
            ' save image to stream
            Dim imageStream As MemoryStream = New MemoryStream()
            imageStream.Position = 0

            ' recognize the barcode from the image stream above
               dim     barcodeReader = New Aspose.BarCodeRecognition.BarCodeReader(imageStream, BarCodeReadType.Code93Extended)

            barcodeReader.Timeout = 2500

            Do While barcodeReader.Read()
            ' close the reader

   GetBarcodePDF = listCodes
    Catch ex As Exception
        m_exception = ex.Message
    End Try
End Function


It is always recommended to use the latest version of the APIs as the latest version contains the bug fixes reported by customer and new features. Please download the latest version of Aspose.BarCode for .NET and try it at your end. In case the issue persists, forward us the sample input PDF files. We will investigate the issue and update you about our findings. Furthermore you may request a temporary license for testing purpose.