Skip to content
Snippets Groups Projects
Commit 2ea8f85e authored by Guillaume Heurtier's avatar Guillaume Heurtier
Browse files

FEAT #14242 TIME 0:10 fix convert pdf to 1.4 after conversion by only office

parent d29ec1ae
No related branches found
No related tags found
No related merge requests found
...@@ -447,6 +447,13 @@ class OnlyOfficeController ...@@ -447,6 +447,13 @@ class OnlyOfficeController
return ['errors' => 'Cannot save converted document']; return ['errors' => 'Cannot save converted document'];
} }
$tmpFilename = $tmpPath . "tmp_{$GLOBALS['id']}_" . rand() . ".pdf";
$command = "gs -dCompatibilityLevel=1.4 -q -sDEVICE=pdfwrite -dNOPAUSE -dQUIET -dBATCH -o {$tmpFilename} {$filename} 2>&1; mv {$tmpFilename} {$filename}";
exec($command, $output, $return);
if (!empty($output)) {
return ['errors' => implode(",", $output)];
}
return true; return true;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment