How to read PDF file and search for specific value


  • Joined: Jul 30, 2013
  • Posts: 3

Tue 7/30/2013 - 19:18

We receive PDF reports from an outside service through an automated scheduler. I would like to trigger a job every 15min to look for a PDF, open/read it and search for a specific keyword from a data-source list. Then move these files into a subfolder, which will be named with matching keyword found. For example, if the PDF file has the keyword 'Outpatient', then I want the PDF file moved to a subfolder called 'Outpatient'



  • Joined: Nov 13, 2011
  • Posts: 318

Thu 8/1/2013 - 17:58

Well, WA can not read a PDF file directly. The following approach will work only if your pdf source files contain search-able &/or selectable text:

[1] We're going to use a command line application that will convert the pdf file to a text file. "Convert" in the sense: save available selectable/search-able text inside the pdf file to a temporary file: "%TempFile%" using a CLI app.: "pdftotext.exe" from "xpdf" package, available at:
[Under "Precompiled binaries" > "x86, Windows" > Download ""]


[2] Extract the contents of "" > Locate "pdftotext.exe" > Copy the full path of "pdftotext.exe" to clipboard.

[3] Download the attached job file (*.waj) > Import the job file, here's how: WA Console > File Menu > Import Job > Browse and select the downloaded file.

[4] Edit newly added job > Set variable "%path_to_pdftotext%" to the location of "pdftotext.exe" i.e., paste the previously copied path from clipboard.

[5] Similarly, set the required keyword variable & other dependent variables while editing the job.

[6] Finally, after the variables are correctly set, select the job in WA Console & click the "Edit triggers" icon > click "Add New Trigger" button > Select "Recurring trigger" from list > Click "Add trigger" > Set to 15 mins.

Test *.pdf file attached.

pdf_txt_search_then_move_v1.waj test.pdf



  • Joined: Nov 22, 2012
  • Posts: 68

Thu 4/3/2014 - 22:13

something to add in future WinAutomation version.
would be nice if it does directly. 


Data Processor

  • Joined: Mar 21, 2014
  • Posts: 86

Fri 4/4/2014 - 5:18

My process is completely different for those pesky PDF files:


1)  Right Click the PDF filename.

2)  Select the "Open With" windows menu option

      a.  from inside that pop-up Menu:  Select Google Chrome

3)  Wait for the PDF to load in Chrome

4)  Type (Control({A}))

     a.  to highlight all selectable text

5)  Type (Control({C}))

     a.  to copy all selected text to the windows clipboard


6)  Open Notepad and type (Control({V})) to paste the clipboard text/PDF Text into Notepad.

7)  Type (Control({S}))

     a.  to save the .txt file somewhere useful.


Hope that helps anybody (like me) straying this way in the future.   : ).




  • Joined: Nov 22, 2012
  • Posts: 68

Sat 4/5/2014 - 19:36

I selected all PDF files.
Combined then with a combine option and used the search feature to do my job. 

that was simple. 
but a person who is getting 30 pdfs per day, it may help him.



  • Joined: Jun 24, 2013
  • Posts: 4

Tue 8/25/2015 - 4:17


I wonder whether you have worked it out. And I have only tried to convert PDF with the help of some 3rd party toolkits. When it comes to PDF conversion process, I have another question for you. I wonder have you ever tried to convert PDF to image files before? I am testing the related PDF to JPG converting, PDF to PNG converting, and PDF to BMP converting programs these days. Do you have experience about it? Any suggestion will be appreciated. Thanks in advance.   




Best regards,


Not a member yet? Register

Copyright 2014 - Softomotive Ltd