noalyss-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Noalyss-commit] [noalyss] 36/46: get the output with transform2pdf in c


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 36/46: get the output with transform2pdf in case it fails
Date: Tue, 13 Jul 2021 05:02:01 -0400 (EDT)

sparkyx pushed a commit to branch master
in repository noalyss.

commit 38bcc36789215319612c423670b47a98a22bbce2
Author: sparkyx <danydb@noalyss.eu>
AuthorDate: Thu Jun 24 14:25:35 2021 +0200

    get the output with transform2pdf in case it fails
---
 include/class/document.class.php | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/include/class/document.class.php b/include/class/document.class.php
index 28e618b..ff3bdba 100644
--- a/include/class/document.class.php
+++ b/include/class/document.class.php
@@ -1860,10 +1860,12 @@ class Document
         mkdir($dirname);
         $destination_file=$dirname."/".$this->d_filename;
         $this->export_file($destination_file);
-        
+        ob_start();
         passthru(OFFICE . escapeshellarg($destination_file), $status);
+        $result =ob_get_contents();
+        ob_clean();
         if ($status != 0) {
-            \record_log(__FILE__."DOC45 : Error  cannot transform into PDF");
+            \record_log(__FILE__."DOC45 : Error  cannot transform into PDF"." 
output [$result]");
             throw new \Exception("DOC45 Cannot not transform to PDF");
         }
         // remove extension



reply via email to

[Prev in Thread] Current Thread [Next in Thread]