webkitpdf.php
authorAlan Knowles <alan@roojs.com>
Mon, 23 Nov 2015 05:32:38 +0000 (13:32 +0800)
committerAlan Knowles <alan@roojs.com>
Mon, 23 Nov 2015 05:32:38 +0000 (13:32 +0800)
webkitpdf.php

index c8683a0..e2f0f2c 100644 (file)
@@ -56,8 +56,13 @@ class WebkitPdf
         
         $cmd = "timeout 30s $xvfb --auto-servernum $webkitpdf  " .
                 " --url " . escapeshellarg($_REQUEST['url']) . ' ' .
-                " --pdf " . $tmpfile . ' ';
+                " --pdf " . $out . ' ';
                 
+        $res = `$cmd`;
+        
+        if (!file_exist($out)) {
+            $this->h404("Failed to create file $cmd  ==> $res");
+        }