catch exception for badly formated pdf