I am wandering if anybody has a reliable way of determine whether a PDF document is actually a PDF document, and that it isn\'t corrupted.
I generate reports on my syste
You can use pdfinfo, centos installation command:
pdfinfo
centos
yum install poppler-utils
... and use pdfinfo command. The PHP code is as follows:
if(!exec("pdfinfo test.pdf")){ echo "file is corrupted" }