PDF inventory software

b. f. bf1783 at googlemail.com
Thu Jun 11 00:14:26 UTC 2009

>Hmm.. The command
>find *.pdf -exec pdftotext {} \;
>works in directories in which no PDF file returns the "Document has
>not the mandatory ending %EOF" error.  When a directory contains one
>of these files, none of the files get converted.  Is there some way to
>ignore or skip over this %EOF problem and continue operating on the
>remaining PDFs?

Use something like:

find -X DIR -name '*.[pP][dD][fF]' | xargs -I % pdftotext "%"

where DIR is the root of the filesystem directory hierarchy to be searched.
Be careful of how many arguments you feed to pdftotext: it can overwrite
files.  You may need to handle some files with encryption, etc. differently.


More information about the freebsd-questions mailing list