File extensions are just a text based convention. Renaming a file to end in .PDF does not make the file a valid PDF.
You're really saying there's no way for a posix shell to take the text to the right of the last "." character and then do simple string comparison on the result?
Also why can't you just use normal globbing to feed arguments to your command? Why do you need to involve flow control?