Find text position not working

pdf
activities
studio

#1

Hello, so I have an pdf invoice and I want to find the sender. I have a field “From” and I want to find that field position. The text appear only one time, but somehow the “Find text position” didn’t work. Always it’s returning “Text was not found”. But the text it is there and it is not an image.
Also “Text exists” activity is returning false every time.


#2

Hi @nemtutruben
use read PDF with OCR activity and store the entire content in a string variable
based on string variable check the position of the value by using substring
StringContent.toString.substring(positionnumber)

Thanks
Ashwin S


#3

@AshwinS2 yeah but I dont want to use OCR, is maybe there an workaround?


#4

Hi @nemtutruben,

try this way,

use read pdf text you will get the string value.
From that you can find indexof

Refer this link
https://www.dotnetperls.com/indexof

Regards,
Arivu


#5

@arivu96 I have tried that solution but in my case is not the good one. I don’t know the sender or company name, i just know the text “From” and what I want is below. With read pdf it will get me the string but the company name will not the next word after “From” because I have multiple words on that line but on the other side of the invoice (how it is a invoice).


#6

@nemtutruben, can you send that text format, so i can give the solution


#7

@arivu96 also what i want to do is not only for 1 type of invoice, I want to be dynamic, for every type of invoice i will receive to take the company name.


#8

Hi @nemtutruben,

Use Read PDF Text activity to get the output as strvalue(string value)

First condition check “From” keyword is there or not.
use if condition strvalue.contains(“From:”)

If True->
arrvalue= strvalue.Split(Environment.NewLine.ToArray, StringSplitOptions.RemoveEmptyEntries)

Use ForEach activity

inside use if condition

item.Contains(“From:”)
if True-> take the next line is Company name.

Regards,
Arivu