Getting error with pdf activity

pdf
studio
uipath

#1

Hi,

When trying to extract text from a pdf file I get this error:

Main has thrown an exception

Source: Read PDF with OCR

Message: Unable to cast object of type ‘EmptyDelegateActivity’ to type ‘System.Activities.ActivityWithResult’.

Exception Type: InvalidCastException

System.InvalidCastException: Unable to cast object of type ‘EmptyDelegateActivity’ to type ‘System.Activities.ActivityWithResult’.
at System.Activities.Runtime.FuncCompletionCallbackWrapper1.GatherOutputs(ActivityInstance completedInstance) at System.Activities.Runtime.CompletionCallbackWrapper.CreateWorkItem(ActivityInstance completedInstance, ActivityExecutor executor) at System.Activities.Runtime.CompletionBookmark.GenerateWorkItem(ActivityInstance completedInstance, ActivityExecutor executor) at System.Activities.Runtime.ActivityExecutor.ScheduleCompletionBookmark(ActivityInstance completedInstance) at System.Activities.Runtime.ActivityExecutor.ScheduleDelegate(ActivityDelegate activityDelegate, IDictionary2 inputParameters, ActivityInstance parent, LocationEnvironment executionEnvironment, CompletionBookmark completionBookmark, FaultBookmark faultBookmark)
at System.Activities.NativeActivityContext.InternalScheduleDelegate(ActivityDelegate activityDelegate, IDictionary2 inputParameters, CompletionBookmark completionBookmark, FaultBookmark faultBookmark) at System.Activities.NativeActivityContext.ScheduleFunc[T,TResult](ActivityFunc2 activityFunc, T argument, CompletionCallback`1 onCompleted, FaultCallback onFaulted)
at UiPath.PDF.Activities.ReadOCRFileActivity.SchenduleProcessImage(NativeActivityContext context)
at UiPath.PDF.Activities.ReadOCRFileActivity.EndExecute(NativeActivityContext context, IAsyncResult result)
at UiPath.PDF.Activities.AsyncNativeActivity.BookmarkResumptionCallback(NativeActivityContext context, Bookmark bookmark, Object value)
at System.Activities.Runtime.BookmarkCallbackWrapper.Invoke(NativeActivityContext context, Bookmark bookmark, Object value)
at System.Activities.Runtime.BookmarkWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)

Also, when I insert the read pdf activity it doesn’t automatically create a variable to output text.


#2

A guess.!!

You need to add an OCR engine in Read Pdf body. like below:

image

Regards…!!
Aksh