Fix pdf viewing, emailing and downloading