detect corrupt pdf

From: Date: Fri, 18 Jul 2003 07:31:52 +0000
Subject: detect corrupt pdf
Groups: php.windows 
Request: Send a blank email to php-windows+get-20827@lists.php.net to get a copy of this message
hey there i was wondering if anyone knows how to detect that a dynamic generated pdf (php 4.3 with pdflib) is corrupt? it seems that if u use pdf_open_file($pdf,"c:\winnt\temp\test.pdf"); and there is a fatal error in the script that the pdf file is actually generated (when infact you dont want it to be, hence detecting that the pdf file is corrupt) i have tried to delete the pdf file (as i can assume that if the file is not created, or not there, there was an error) when an error is encountered with set_error_handler("catcherror"); but it doesnt seem to be doing the job, prolly because you cant capture E_ERROR's. i also thought of using pdf_open_pdi(); function, but it doesnt seem to be included in the php_pdf.dll. so does anyone have any ideas on how to check if a pdf file is corrupt? also does anyone know how to capture ALL errors, even fatal ones (E_ERROR's)? thanks Zac

« previous php.windows (#20827) next »