]> _ Git - cubist_pdf.git/commitdiff
wip #6615 @0.25
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 16 Jan 2024 19:13:09 +0000 (20:13 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 16 Jan 2024 19:13:09 +0000 (20:13 +0100)
src/PDFTools.php

index 740f4be1076d0086a40a74c75b8c341b8f41cc59..fe384a27aa894fe8acaa46ad173259b1918eb7e6 100644 (file)
@@ -393,26 +393,27 @@ class PDFTools
         $pdftoppm->execute();
         $tmp .= '.ppm';
 
-//        $output = $pdftoppm->getOutput();
-//        $errors = ['end of file inside dictionary',
-//            'leftover args in content stream',
-//            'document stream is empty',
-//            'premature end of data segment',
-//            'corrupt jpeg data',
-//            'couldn\'t find trailer dictionary',
-//            'invalid xref entry',
-//            'incorrect stream length',
-//            'try to reconstruct',
-//            'error opening pdf file',
-//        ];
-//
-//        foreach ($errors as $error) {
-//            if (stristr($output, $error)) {
-//                unlink($tmp);
-//                $pdftoppm->debug();
-//                return;
-//            }
-//        }
+        $output = $pdftoppm->getOutput();
+        $errors = [
+            //'end of file inside dictionary',
+            'leftover args in content stream',
+            'document stream is empty',
+            //'premature end of data segment',
+            //'corrupt jpeg data',
+            //'couldn\'t find trailer dictionary',
+            //'invalid xref entry',
+            //'incorrect stream length',
+            //'try to reconstruct',
+            //'error opening pdf file',
+        ];
+
+        foreach ($errors as $error) {
+            if (stristr($output, $error)) {
+                unlink($tmp);
+                $pdftoppm->debug();
+                return;
+            }
+        }
 
 
         if (file_exists($tmp)) {