In a Ruby web application I want users to be able to upload documents. If the user uploads a Microsoft Word file (.doc) I want Ruby to count the number of pages in the file. It would be even slicker to get the number of words, but the number of pages will do.
How would I do that? Is there a Ruby library/gem that can do that for me? Is it even possible, given the DOC-format?