[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: cmdline tool to search through pdf files?



On 6/21/07, Tobias Nissen <tn@movb.de> wrote:
> Hello Bruno!
>
> Bruno Buys wrote:
> > I'd like to be able to search keywords in pdf files using cmd line
> > tools. My intention is to write shell scripts to automate heavy duty
> > keyword searching. Anyone has experience with that?
>
> As Tod wrote *most* PDFs are mainly text, i.e. not all. But for those
> which are,
>
>   pdftotext doc.pdf - | grep -i keyword
>
> is a simple method to search for keywords in a PDF-file. pdftotext is
> part of the xpdf-utils package.
>
> Regards,
> Tobias

This should work fairly well. I have these lines in my .vimrc:

autocmd BufReadPre *.pdf set ro
autocmd BufReadPost *.pdf silent %!pdftotext -nopgbrk "%" - |fmt -csw7

and I can read most PDFs I have with vim.


Cheers,
Kelly



Reply to: