PDF inventory software

Polytropon freebsd at edvax.de
Tue Jun 9 09:19:01 UTC 2009

On Mon, 8 Jun 2009 23:11:50 -0400, Daniel Underwood <djuatdelta at gmail.com> wrote:
> Since all the PDFs contain text (none are scanned "images"), can I
> simply use some command like grep to search for text within the
> collection?  If so, how would I do this?  Can grep read text from
> within PDFs?

I don't think so, because PDF files seem to be binary format.
There are two ways. The first is using the "strings" program
that can isolate printable strings from binary files. The
second - the much better way - is to use "pdftotext" to turn
the PDF files into regular ASCII text which is greppable then.
You could write a kind of "pdfgrep" tool that acts as a wrapper
around pdftotext, grep, and your PDF file collection.

In any case, it would surely help if your files have meaningful
filenames, so they can easily be identified.

>From Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...

More information about the freebsd-questions mailing list