I’m stuck on reading pdf. I don’t know what to do. I tried what ever I knew. Need yours help. Below are error.
read pdf file has thrown an exception
Source: Read PDF text
Message: One or more errors occurred.
Exception Type: AggregateException
System.AggregateException: One or more errors occurred. —> System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)
at UiPath.PDF.Pdfium.PdfiumMethods.FPDF_InitLibrary()
at UiPath.PDF.Activities.PDFReader…ctor(String filePath, String password)
at UiPath.PDF.Activities.ReadPDFText.GetFileReader(String fileName, String password)
at UiPath.PDF.Activities.ReadTextFileActivity.<>c__DisplayClass24_0.b__0()
at System.Threading.Tasks.Task1.InnerInvoke() at System.Threading.Tasks.Task.Execute() --- End of inner exception stack trace --- at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) at System.Threading.Tasks.Task1.GetResultCore(Boolean waitCompletionNotification)
at System.Threading.Tasks.Task1.get_Result() at UiPath.PDF.Activities.ReadTextFileActivity.EndExecute(AsyncCodeActivityContext context, IAsyncResult result) at System.Activities.AsyncCodeActivity.System.Activities.IAsyncCodeActivity.FinishExecution(AsyncCodeActivityContext context, IAsyncResult result) at System.Activities.AsyncCodeActivity.CompleteAsyncCodeActivityData.CompleteAsyncCodeActivityWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager) ---> (Inner Exception #0) System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B) at UiPath.PDF.Pdfium.PdfiumMethods.FPDF_InitLibrary() at UiPath.PDF.Activities.PDFReader..ctor(String filePath, String password) at UiPath.PDF.Activities.ReadPDFText.GetFileReader(String fileName, String password) at UiPath.PDF.Activities.ReadTextFileActivity.<>c__DisplayClass24_0.<ExecuteAsync>b__0() at System.Threading.Tasks.Task1.InnerInvoke()
at System.Threading.Tasks.Task.Execute()<—
System.AggregateException: One or more errors occurred. —> System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)
at UiPath.PDF.Pdfium.PdfiumMethods.FPDF_InitLibrary()
at UiPath.PDF.Activities.PDFReader…ctor(String filePath, String password)
at UiPath.PDF.Activities.ReadPDFText.GetFileReader(String fileName, String password)
at UiPath.PDF.Activities.ReadTextFileActivity.<>c__DisplayClass24_0.b__0()
at System.Threading.Tasks.Task1.InnerInvoke() at System.Threading.Tasks.Task.Execute() --- End of inner exception stack trace --- at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) at System.Threading.Tasks.Task1.GetResultCore(Boolean waitCompletionNotification)
at System.Threading.Tasks.Task1.get_Result() at UiPath.PDF.Activities.ReadTextFileActivity.EndExecute(AsyncCodeActivityContext context, IAsyncResult result) at System.Activities.AsyncCodeActivity.System.Activities.IAsyncCodeActivity.FinishExecution(AsyncCodeActivityContext context, IAsyncResult result) at System.Activities.AsyncCodeActivity.CompleteAsyncCodeActivityData.CompleteAsyncCodeActivityWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager) ---> (Inner Exception #0) System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B) at UiPath.PDF.Pdfium.PdfiumMethods.FPDF_InitLibrary() at UiPath.PDF.Activities.PDFReader..ctor(String filePath, String password) at UiPath.PDF.Activities.ReadPDFText.GetFileReader(String fileName, String password) at UiPath.PDF.Activities.ReadTextFileActivity.<>c__DisplayClass24_0.<ExecuteAsync>b__0() at System.Threading.Tasks.Task1.InnerInvoke()
at System.Threading.Tasks.Task.Execute()<—
Thanks & regards,
Sachchidanand Vishwakarma
An ExceptionDetail, likely created by IncludeExceptionDetailInFaults=true, whose value is:
System.AggregateException: One or more errors occurred. ----> System.NullReferenceException: Object reference not set to an instance of an object.
at UiPath.PDF.Activities.PDFReader.GetPageText(Int32 pageNo)
at UiPath.PDF.Activities.ReadTextFileActivity.<>c__DisplayClass24_0.b__0()
at System.Threading.Tasks.Task1.InnerInvoke() at System.Threading.Tasks.Task.Execute() --- End of inner ExceptionDetail stack trace --- at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) at System.Threading.Tasks.Task1.GetResultCore(Boolean waitCompletionNotification)
at System.Threading.Tasks.Task`1.get_Result()
at UiPath.PDF.Activities.ReadTextFileActivity.EndExecute(AsyncCodeActivityContext context, IAsyncResult result)
at System.Activities.AsyncCodeActivity.System.Activities.IAsyncCodeActivity.FinishExecution(AsyncCodeActivityContext context, IAsyncResult result)
at System.Activities.AsyncCodeActivity.CompleteAsyncCodeActivityData.CompleteAsyncCodeActivityWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
Update PDF package to latest version in studio. This worked for me. Production server had latest Uipath version where older pdf package is not compatible