Reputation: 145
I have an image which is a scanned copy of a page, in .tiff format. As per my research, UiPath doesn’t support tiff format - so i converted it manually to jpg, using it as an input. As it is a image, I am using screen scrapping along with Google OCR - the quality is not as expected, but they are at an acceptable level. Now, the issues that I am facing are as mentioned below.
Upvotes: 0
Views: 628
Reputation: 2349
I am getting below error
Make sure your selectors are resilient by using wildcards. The most likely cause for your error is that UiPath looks for a window with the exact title your-file-name.tif
(you redacted that part). This will always fail when you open another image with a different name.
This selector looks for an IrfanView application with the precise title:
<wnd app='i_view32.exe' cls='IrfanView' title='UK1.tif - IrfanView (Zoom: 618 x 874)' />
By introducing wildcards, you can just look for any tif file opened in IrfanView:
<wnd app='i_view32.exe' cls='IrfanView' title='*.tif*' />
Is there a better way to get the text from the image?
Instead of opening the image in a viewer, you can directly load it into a variable of type System.Drawing.Image
. Note that this supports most TIFF files, as well - so, there is no need for conversion. Then you could use the Google Cloud OCR
activity to perform OCR, storing the words and OCR text in two dedicated variables. Check out the help for more details.
Upvotes: 2