Hi, I am reading config in which column 1 consists of the annexure titles under which the pdf annexure should be placed. the path of the annexures are give simultaneously in column 2. The document is a pdf and we should find the test in column 1 in order to attach the annexure. how do i find a text in the pdf using UiPath activities ?
Hi @RACHEL_PAUL
using READ PDF Text activity you can read the whole text in pdf then you can use regex to read the specific text.
i have to navigate to the text in pdf how do i do that?
- Install UiPath.PDF.Activities: Ensure you have the UiPath.PDF.Activities package installed in UiPath Studio.
- Use
Read PDF TextActivity: Add theRead PDF Textactivity to extract text from the PDF file. - Search for Text: Use string methods like
pdfText.Contains("desired_text")to check if the desired text exists in the extracted PDF text. - Attach Annexure Based on Result: If the text is found (
Truecondition), proceed to attach the annexure using the associated path.
Sequence
Variables
pdfText (String)
Activities
Read PDF Text
FilePath: “path_to_your_pdf.pdf”
Output: pdfText
If pdfText.Contains(“desired_text”)
Then
// Attach annexure using the path from your configuration
AttachAnnexureActivity(PathFromConfiguration)
Else
Log Message: “Desired text not found in the PDF.”
IF PDF is native then you can read the PDF using PDF read activity then use the regex to get the specific data from PDF