Error OCRing large file

PDF-X OCR SDK is a New product from us and intended to compliment our existing PDF and Imaging Tools to provide the Developer with an expanding set of professional tools for Optical Character Recognition tasks

Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Sean - Tracker, Chris - Tracker Supp, Tracker Supp-Stefan

Post Reply
Tom Princen
User
Posts: 83
Joined: Wed Mar 25, 2015 10:15 am

Error OCRing large file

Post by Tom Princen » Wed Dec 21, 2016 9:11 am

When I try to ocr a file I get this error:

System.Runtime.InteropServices.SEHException was unhandled
Message=Een extern onderdeel heeft een uitzondering veroorzaakt.
Source=
ErrorCode=-2147467259
StackTrace:
bij _Namespace..OCR_MakeSearchable(IntPtr pdf, PXO_Options& Options, IntPtr pagelist)
bij _Namespace..OCR_MakeSearchable_NoRef(IntPtr pdf, PXO_Options Options) in C:\Visual Studio Projects\\\.cs:regel 13
bij WindowsFormsApplication1.Form1.button2_Click(Object sender, EventArgs e) in C:\Visual Studio Projects\\WindowsFormsApplication1\Form1.cs:regel 114
bij System.Windows.Forms.Control.OnClick(EventArgs e)
bij System.Windows.Forms.Button.OnClick(EventArgs e)
bij System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
bij System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
bij System.Windows.Forms.Control.WndProc(Message& m)
bij System.Windows.Forms.ButtonBase.WndProc(Message& m)
bij System.Windows.Forms.Button.WndProc(Message& m)
bij System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
bij System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
bij System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
bij System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
bij System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
bij System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
bij System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
bij System.Windows.Forms.Application.Run(Form mainForm)
bij WindowsFormsApplication1.Program.Main() in C:\Visual Studio Projects\\WindowsFormsApplication1\Program.cs:regel 18
bij System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
bij System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
bij Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
bij System.Threading.ThreadHelper.ThreadStart_Context(Object state)
bij System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
bij System.Threading.ThreadHelper.ThreadStart()
InnerException:


BTW I Could not attach file: The file is too big, maximum allowed size is 5 MiB...

Ivan - Tracker Software
Site Admin
Posts: 3607
Joined: Thu Jul 08, 2004 10:36 pm
Location: Vancouver Island - Canada
Contact:

Re: Error OCRing large file

Post by Ivan - Tracker Software » Thu Dec 22, 2016 11:59 pm

If you are using 32-bit DLL, I'm afraid the process cannot allocate continues chunk of memory large enough to keep required images for OCR, as the 32-bit processes has limited address space and that space often become fragmented, so, even if most of the address space is free, there are no continues block of memory.

As a solution I can see switching to 64-bit DLLs, if possible, or try to reduce quality/DPI used for OCR documents.
Tracker Software (Project Director)

When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.

Tom Princen
User
Posts: 83
Joined: Wed Mar 25, 2015 10:15 am

Re: Error OCRing large file

Post by Tom Princen » Fri Dec 23, 2016 10:39 am

Switching to 64 is not that simple.

Another option is to implement better memory handling in your code...

User avatar
Paul - Tracker Supp
Site Admin
Posts: 4936
Joined: Wed Mar 25, 2009 10:37 pm
Location: Chemainus, Canada
Contact:

Re: Error OCRing large file

Post by Paul - Tracker Supp » Fri Dec 23, 2016 7:45 pm

Hi Tom,

we are always working on improving our code. Given the declining use of 32 bit systems and the 64 bit solution presented, we would consider this is a rather low priority "issue" I'm afraid.

I do not expect to see the 32 bit code "improved" in any practical time frame for your purposes, if at all.

I do apologise for any inconvenience this may cause.
_________________
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards

Paul O'Rorke
Tracker Support North America
http://www.tracker-software.com

Post Reply