Search for Text though Multiple PDFs in a Driectory and Show Line Numbers, Output to a Text File

find <path> -name '*.pdf' -exec sh -c 'pdftotext "{}" - | grep -in --with-filename --label="{}" --color "<pattern>"' \; > <filename>.txt

Source