Error reading a PDF


#1

Hello,

I am getting an error while trying to use the Read PDF file activity. Looks like UIPath is looking for the itextsharp package and is unable to find it (I assumed that since UIPath needs it, it should have been included in the distribution package). I found and downloaded the itextsharp.5.5.13.nupkg library. what is the best way to add it to the UIPath?

Thank you in advance,

Mike


#2

what is the error that UiPath studio is showing?


#3

Yash,

Please see below.

Best,
Mike

Project has thrown an exception

Source: Throw

Message: Read PDF text: Could not load file or assembly ‘itextsharp, Version=4.1.6.0, Culture=neutral, PublicKeyToken=8354ae6d2174ddca’ or one of its dependencies. The system cannot find the file specified.

Exception Type: ActivityException

UiPath.Activities.ActivityException: Read PDF text: Could not load file or assembly ‘itextsharp, Version=4.1.6.0, Culture=neutral, PublicKeyToken=8354ae6d2174ddca’ or one of its dependencies. The system cannot find the file specified. —> System.IO.FileNotFoundException: Could not load file or assembly ‘itextsharp, Version=4.1.6.0, Culture=neutral, PublicKeyToken=8354ae6d2174ddca’ or one of its dependencies. The system cannot find the file specified.
at UiPath.Activities.PDFReader…ctor(String filePath, String password)
at lambda_method(Closure , ActivityContext )
at System.Activities.Expressions.LambdaValue1.Execute(CodeActivityContext context) at System.Activities.CodeActivity1.InternalExecuteInResolutionContext(CodeActivityContext context)
at System.Activities.Runtime.ActivityExecutor.ExecuteInResolutionContext[T](ActivityInstance parentInstance, Activity1 expressionActivity) at System.Activities.InArgument1.TryPopulateValue(LocationEnvironment targetEnvironment, ActivityInstance activityInstance, ActivityExecutor executor)
at System.Activities.RuntimeArgument.TryPopulateValue(LocationEnvironment targetEnvironment, ActivityInstance targetActivityInstance, ActivityExecutor executor, Object argumentValueOverride, Location resultLocation, Boolean skipFastPath)
at System.Activities.ActivityInstance.InternalTryPopulateArgumentValueOrScheduleExpression(RuntimeArgument argument, Int32 nextArgumentIndex, ActivityExecutor executor, IDictionary2 argumentValueOverrides, Location resultLocation, Boolean isDynamicUpdate) at System.Activities.ActivityInstance.ResolveArguments(ActivityExecutor executor, IDictionary2 argumentValueOverrides, Location resultLocation, Int32 startIndex)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)
— End of inner exception stack trace —
at System.Activities.Statements.Throw.Execute(CodeActivityContext context)
at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.ActivityInstance.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)


#4

Hi,

You can keep <packagename.version>.nupkg at “C:\Program Files (x86)\UiPath\Studio\Packages” so that it will be available at Local system.

However, you can always choose to upload your package to the orchestrator. Whenever, your process runs-
it first check for package in the local system
then in UiPath feed and
lastly, in Orchestrator.

Hence, in case where same activity is used in multiple workflows shared across 100 bots, the latter will be the best solution as you do not have to keep the <packagename.version>.nupkg at each system’s local drive.

If the above answers do not satisfy your quest, feel free to ask me. Also, please share your use case.


#5

Thank you Abhilash - let me try…

Don’t have an Orchestrator yet but completely agree with you…

I have 2 use cases related to handling the PDF forms - one reading the data from PDF files, and another one completely opposite - auto filling PDF forms. Started with the second one and unfortunately was not able to find a reliable solution with the UIPath yet… Any suggestions?

Best,
Mike


#6

Tried the first option putting a nupkg in the packages folder - did not work…


#7

Hi @mvelik,

For PDF forms, rarely you can find a reliable selector. Hence, use AnchorBase activity (refer image).
First, find the anchor element like "Name: "
then, click on the textbox. (If position of anchor is fixed, you can mention that in properties)
finally, type into activity for typing text.


#8

After keeping <packagename.version>.nupkg at “C:\Program Files (x86)\UiPath\Studio\Packages”, go to Manage Packages> Available > Local
You will find your package name in the window, please install it.


#9

Thank you. Found a problem - UIPath is looking for a specific version of this package not the latest one I downloaded. Is there a way to change it? Or should I go ahead and find that exact version it expects?

Thank you for the tip on PDFs. Unfortunately does not work for us, since UIPath is unable to recognize individual elements in the PDF and always returns the whole document as one element/anchor… It is a huge problem actually since our customer is very interested in automating PDF-related activities…
Appreciate ideas and suggestions

Best,
Mike


#10

Hi,
I guess is… use Index of fixed string.
You get the index of fixed string before and after the value to be retrieved.
And find text between index.


#11

@mvelik, you can always change the version in Project.json file.

Please check if TAB key works for your PDF form. You can try to put values using tab keys in PDF form. However, the PDF tab should be on focus for such operation.
Also, for reading a PDF, try first with screen scrapping with full text option. If it is not working, we should go with OCR (Abbyy produce best results).

Hope it helps.