Please don't post a complete solution to the problem. We encourage people to figure it out for themselves. Hint, suggest, or lead them to the answer, but please don't provide a fully implemented program.
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
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