logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
Taake  
#1 Posted : Wednesday, June 27, 2018 6:00:36 AM(UTC)
Taake

Rank: Newbie

Groups: Registered
Joined: 6/27/2018(UTC)
Posts: 1
Germany
Location: Dortmund

Hi there,

I receive a System.OutOfMemoryException when trying to read Text from a 2-page PDF file:

My Code:
Code:

Try
            OcrApi.LicenseKey = "xxxxx"

            Dim ocr As OcrApi = OcrApi.Create()
            Dim plaintext As String = ""
            'Dim pix As OcrPix

            ocr.Init(Enums.Languages.German)

            'pix = OcrPix.FromFile(txtFilename.Text)
            plaintext = ocr.GetTextFromImage(txtFilename.Text)

            txtInvoice.Text = plaintext

        Catch ex As Exception
            Debugger.Break()
        End Try


Error occurs when ocr.GetTextFromImage function is called.

Stacktrace:
bei System.Drawing.Image.FromFile(String filename, Boolean useEmbeddedColorManagement) bei Patagames.Ocr.OcrApi.GetTextFromImage(String filename) bei fuhrmann.invoicereader.Form1.btnReadInvoice_Click(Object sender, EventArgs e) in C:\Users\....

It works when I'm saving the PDF as 2 JPG pages and use an OcrPix object.
Working on a 16gb Ram Win10 Prof. Machine...

Any ideas?
Paul Rayman  
#2 Posted : Thursday, June 28, 2018 12:56:28 AM(UTC)
Paul Rayman

Rank: Administration

Groups: Administrators
Joined: 1/5/2016(UTC)
Posts: 1,138

Thanks: 10 times
Was thanked: 133 time(s) in 130 post(s)
you may not recognize PDF files directly. Tesseract can process images only.
Please read this article to know how to OCR PDF files.
https://blog.patagames.c...e-pdf-from-scanned-pages

Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.