* Reworked code to prevent a crash when encountering faulty PDF files