handles reading and getting pdf viewer