How do I get bash to complete pdf files with epdfview?

e.g. if I have foo.pdf foo.txt bar.pdf bar.txt, I want to be able to type
epdfview [TAB] and it will complete only the pdfs.

Code:
complete -f -X '!*.@(pdf|PDF)' epdfview
works, but it refuses to complete directories, so I cannot reach pdfs in subdirectories.

I don't want to use the bash-completion package, I want to be able to make my own completions for the programs I use. Unfortunately the documentation for what I want to do seems scant. Generally, I want to be able to bind a set of file extensions to one or more programs, so that pressing tab after that program will ignore none-fitting extensions.