How to search a specific keyword in pdf


I have read pdf . I have a keyword “Department number:” keyword and i want to search this value in pdf.

Please help how should i search it and what is the syntax of it

Can you share the pdf?

No its confidential


You can write a If condition as below

YouPDFOutputVariable.contains(“Department number:”)

Then-> Use Regex to get the Department number as below
(?<=Department Number:).+


Hope this may help you


Hi @Doonline ,

Give a try on the below Expression :

System.Text.RegularExpressions.Regex.Match(pdfText,"(?<=Department number:).*",System.Text.RegularExpressions.RegexOptions.IgnoreCase).Value.ToString