I've written a little bash script that makes it possible to search the contents all the pdfs in a certain folder to find the occurrences of a string.
It uses a zenity gui so it's quite user friendly; after the search is completed the user is provided with a list of files and a double-click opens evince on the page where the first occurrence of the string is.
I hope it can be useful to somebody!
edit. edit a line in order to keep the results window openCode:#!/bin/bash IFS=" " # Select Directory NEWPATH=$(zenity --file-selection --directory --title="Select the Directory") if [ -z "$NEWPATH" ]; then echo 'No Directory Selected' exit 1 fi cd $NEWPATH files=$(ls *.pdf -1) if [ $? != "0" ]; then zenity -error --text='No files to convert!' exit 3 fi #Get Keyword KEYWORD=$(zenity --entry --text="Enter Keyword" --title="Search in PDF") if [ -z "$KEYWORD" ]; then echo 'No keyword' exit 2 fi #Files text exctraction and matching ( for MYFILE in $files; do result=$(pdftotext $MYFILE - | grep $KEYWORD -i) if [ -n "$result" ]; then echo $MYFILE >> '/tmp/pdfFinder' fi done ) | zenity --progress --title='Processing PDFs' --pulsate --auto-close #Checking Results list=$(cat '/tmp/pdfFinder') if [ -z $list ]; then zenity --error --text='No pdf found!' exit 5 fi rm '/tmp/pdfFinder' #Show List until user exits the program or selects a file while [ 1 ]; do fileToOpen=$(zenity --list --column="FileName" --title="Files containing \"$KEYWORD\"" $list) if [ $? == '0' ]; then if [ -z "$fileToOpen" ]; then zenity --error --text='No file Selected' else #Running pdf viewer already looking for our word evince --find=$KEYWORD $fileToOpen fi else exit 4 fi done