Added FILE_TYPE_PDF to distinguish PDF files, support for multi-page PDFs
Replaced Poppler < .22 code with a neater™ version