I notice that you are returning false whether IsEmpty() returns true or false. Is that really what you want to do? Perhaps that is the source of the problem. Otherwise it must be something in the IsEmpty() function. You would need to post that code here to get feedback.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com