OCR UnauthorizedAccessException

Hello,
i have an Problem with the OCR Tesseract.
This is working good:
'Initialize the OCR processor by providing the path of tesseract binaries(SyncfusionTesseract.dll and liblept168.dll)
Dim erg As String = ""
Using processor As New OCRProcessor("TesseractBinaries\")
'Load a PDF document
Dim lDoc As New PdfLoadedDocument(filename)
'Set OCR language to process
processor.Settings.Language = "deu"
processor.Settings.Performance = Performance.Slow
''Process OCR by providing the PDF document And Tesseract data
processor.PerformOCR(lDoc, "Tessdata\")
erg = lDoc.Pages(0).ExtractText()
'Save the OCR processed PDF document in the disk
'Debug.Print(lDoc.Pages(0).ExtractText)
lDoc.Save("Sample.pdf")
lDoc.Close(True)
But when i want to use Regions there is an error Message:
This does not work:

'Initialize the OCR processor by providing the path of tesseract binaries(SyncfusionTesseract.dll and liblept168.dll)
Dim erg As String = ""
Using processor As New OCRProcessor("TesseractBinaries\")
'Load a PDF document
Dim lDoc As New PdfLoadedDocument(filename)
'Set OCR language to process
processor.Settings.Language = "deu"
processor.Settings.Performance = Performance.Slow
Dim rect As New RectangleF(0, 0, 150, 150)
'Assign rectangles to the page
Dim pageRegions As New List(Of PageRegion)()
Dim region As New PageRegion()
region.PageIndex = 1
region.PageRegions = New RectangleF() {rect}
pageRegions.Add(region)
processor.Settings.Regions = pageRegions
''Process OCR by providing the PDF document And Tesseract data
processor.PerformOCR(lDoc, "Tessdata\")
erg = lDoc.Pages(0).ExtractText()
'Save the OCR processed PDF document in the disk
'Debug.Print(lDoc.Pages(0).ExtractText)
lDoc.Save("Sample.pdf")
lDoc.Close(True)
The Error Message is:

System.UnauthorizedAccessException:Access to the path"C:\Users\Username\AppData\Local\Temp\tmpDE21.tmp" is Denied."

Can anyone help me please?

An additional Question:

I try to recognize hand written Numbers but no one of them whererecognized by the OCR. Why not?

Thanks and Greetings

Thomas R.

1 Reply

SK Surya Kumar Syncfusion Team November 14, 2017 10:35 AM UTC

Hi Thomas, 
 
Thank you for using Syncfusion products.  
 
Please find the response for your queries below: 
 
Query 
Response 
The Error Message is: 
 
System.UnauthorizedAccessException:Access to the path"C:\Users\Username\AppData\Local\Temp\tmpDE21.tmp" is Denied." 
 
Can anyone help me please? 
 
We have tried to reproduce the issue which you have mentioned using the code snippet which you have given in the last update. But the issue was not reproduced from our side with the sample which we have provided below: 
Sample link: 
 
Can you please try using the sample given and if the issue occurred please provide us the following details: 
1.       Document in which the issue is reproduced. 
2.       Stack Trace of the exception occurred. 
3.       Environmental details of the machine in which the issue is reproduced: 
                     I.            Current operating System. 
                   II.            System byte info (32/64 bytes). 
                 III.            Culture and language settings. 
                IV.            Anti-virus software if installed any. 
 
Note: If you use Anti-virus software pleasure ensure that it does not use the temp file path of the system while performing OCR.  
 
An additional Question: 
 
I try to recognize hand written Numbers but no one of them whererecognized by the OCR. Why not? 
 
Please provide the document in which the issue is occurred so that we will analyse and let you know the details. 
 
Please let us know if you need any further information in this. 
 
Regards, 
Surya Kumar 


Loader.
Up arrow icon