I am working to automate a process to convert each page of a pdf file to a image file.
The process is like
Open PDF
Capture Actual page - correct capture
While loop until actual page = total page
Click in the middle of a page
Ctrl C
Open Paint
Ctrl V
Save paint
Intro in pdf to go to the next page
capture actual page again -correct capture
The first loop is perfect. I could see that the robot makes the intro in PDF document correctly and pass page.
But, when the Robot open paint in the second loop the PDF go back to first page automatically. (I mean I could save first and second page)
So I couldn’t catch third o fourth page.
I checked the selectors trying to find something wrong, but I didn’t find anything because I modify to general PDF and I have the same problem with different one.
Well, the problem is not to save with paint, the problem is when I am saving, the application PDF go back to the first page.
Moreover, the activity save image doesn’t recognize pdf files.
OkI thought you are taking screenshots of Pdf page and saving them.
Since you are opening paint which is a different application, probably PDF is not
Staying on the page it is supppsed to be.
just an fyi…If you are capturing image in PDF and want to save locally, you could try in below way instead of opening paint.Since your PDF image is in the clipboard, you could extract and save your clipboard(System.Windows.Forms.Clipboard VariableType) image(System.Drawing.Image Variable Type).
I am trying something you have done. I am getting the image on the clipboard, but I get this error while saving it. But, when I remove excel scope and just run the clipboard (which has the picture on it) and save, it does save whatever is on my clipboard. So confusing.
Message: Save image failed. Check if the file name is a valid path
Exception Type: ImageOperationException
UiPath.Core.ImageOperationException: Save image failed. Check if the file name is a valid path —> System.NullReferenceException: Object reference not set to an instance of an object.
at UiPath.Core.Image.SaveFile(String fileName)
— End of inner exception stack trace —
at System.Activities.Statements.MethodExecutor.InvokeAndUnwrapExceptions(Func`3 func, Object targetInstance, Object actualParameters)
at System.Activities.Statements.MethodResolver.SyncMethodExecutor.BeginMakeMethodCall(AsyncCodeActivityContext context, Object target, AsyncCallback callback, Object state)
at System.Activities.Statements.MethodExecutor.BeginExecuteMethod(AsyncCodeActivityContext context, AsyncCallback callback, Object state)
at System.Activities.Statements.InvokeMethod.BeginExecute(AsyncCodeActivityContext context, AsyncCallback callback, Object state)
at System.Activities.AsyncCodeActivity.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)