12

When I want to search a snipet, like searchPart1 some unknown text searchPart2 in a text file, I use searchPart1.*searchPart2. But this is not possible in any pdf reader I use. Currently I convert pdf to a text file and open it using less or geany, then use regular expression available on it.

Is there a Pdf reader with regular expression search other than the commandline pdfgrep

  • pdfgrep is a grepper so it didn't answer the question completely. A pdf reader with inbuilt pdfgrep is required to accept the answer – totti Feb 28 '13 at 6:32
10

pdfgrep, in the repos, isn't exactly a reader and requires use of the terminal but it eliminates the need to first convert the pdf file to a text file and then to open that in a capable text editor:

pdfgrep

In addition to the features listed in Synaptic, you can search multiple files and recursively. One big difference from regular grep is that pdfgrep doesn't provide line numbers but page numbers. man pdfgrep has details.

A simple example:

pdfgrep -in PATTERN FILENAME

Here, i is for case-insensitivity and n gives the page number, not line number.

An example of the output looks like:

pdfgrep output

There's a brief YouTube video, Pdfgrep - Search Text Inside PDF Files - Linux CLI , as well.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.