Text Exists in PDF

Hi,
Which activity can used to find a specific text (e.g. “Welcome”) in pdf without extracting text from pdf.

Hi @Gowthaman_Subramanian

=> Use Read PDF text activity to read the PDF and store the output in a variable say str_text.

=> Use an If condition and give below condition:

If
Str_text.ToString.ToUpper.Contains( "WELCOME")
Then
    // Do required process
Else
    // Do required process
End If

Hope it helps!!

@Gowthaman_Subramanian,

Unfortunately, no out of the box activity. You will have to extract text and then check for the desired value.

Thanks,
Ashok :slight_smile:

1 Like

Thanks Parvathy. But, text should find without extracting pdf for validating the ‘.pdf’ file whether native or scanned.

Hi @Gowthaman_Subramanian

Unfortunately there is no such way to do.

One way is
=> Use Read PDF Text to read the PDF and store the output in a variable say str_text.

=> Use below condiiton in If

If
(Not String.IsNullOrEmpty(str_text) or Not String.IsNullOrWhiteSpace(str_text)) AND str_text.ToUpper.Contains("WELCOME")
Then
  \\ your PDF is not an scanned PDF and proceed with further actions
Else
  \\ your PDF is an scanned PDF and proceed with further actions what you want to do.
End If

Hope it helps!!

1 Like

I got the result. Thank you.

Hi @Gowthaman_Subramanian

Hope your query is resolved. If yes, please mark my post as solution to close the loop or if you have any more queries, I’m happy to help.

Regards

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.