From 8bd27169379fcce7a9ebe726bd37c3511478147d Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Fri, 24 Sep 2021 16:32:51 +0000 Subject: [PATCH] wip #4706 @2 --- inc/ws/Controlleur/class.ws.maintenance.php | 2 +- inc/ws/Metier/class.ws.document.php | 2 +- inc/ws/Util/class.ws.pdf.convert.php | 6 ++++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/inc/ws/Controlleur/class.ws.maintenance.php b/inc/ws/Controlleur/class.ws.maintenance.php index 5768436fc..b4d2399ab 100644 --- a/inc/ws/Controlleur/class.ws.maintenance.php +++ b/inc/ws/Controlleur/class.ws.maintenance.php @@ -911,7 +911,7 @@ class wsMaintenance header('Content-type: image/svg+xml'); $svg = wsDocument::getDir($p['document_id']) . '/html/p' . $p['document_page'] . '.svg'; - $pdftocairo = new cubeCommandLine('pdftocairo'); + $pdftocairo = new cubeCommandLine(wsPDFConvert::PDFTOCAIRO); $pdftocairo->setPath(CONVERTER_PATH); $pdftocairo->setArg('f', $p['document_page']); $pdftocairo->setArg('l', $p['document_page']); diff --git a/inc/ws/Metier/class.ws.document.php b/inc/ws/Metier/class.ws.document.php index edb722f73..e50ef3b07 100644 --- a/inc/ws/Metier/class.ws.document.php +++ b/inc/ws/Metier/class.ws.document.php @@ -132,7 +132,7 @@ class wsDocument extends cubeMetier $this->addToLog($pdftk); if (!file_exists($this->fixed)) { - $pdftocairo = new cubeCommandLine('pdftocairo'); + $pdftocairo = new cubeCommandLine(wsPDFConvert::PDFTOCAIRO); $pdftocairo->setPath(CONVERTER_PATH); $pdftocairo->setArg(null, '-pdf'); $pdftocairo->setArg(null, $this->in); diff --git a/inc/ws/Util/class.ws.pdf.convert.php b/inc/ws/Util/class.ws.pdf.convert.php index 92baefa35..ebac91d44 100644 --- a/inc/ws/Util/class.ws.pdf.convert.php +++ b/inc/ws/Util/class.ws.pdf.convert.php @@ -8,6 +8,8 @@ */ class wsPDFConvert { + const PDFTOCAIRO = '/usr/bin/pdftocairo'; + const PDFTOPPM = '/usr/bin/pdftoppm'; public static function makeMiniShot($in, $out, $page, $format = 'jpg') { @@ -103,7 +105,7 @@ class wsPDFConvert // return; // } - $pdftocairo = new CubeIT_CommandLine('pdftocairo'); + $pdftocairo = new CubeIT_CommandLine(self::PDFTOCAIRO); $pdftocairo->setPath(CONVERTER_PATH); $pdftocairo->setArg('f', $page); $pdftocairo->setArg('l', $page); @@ -227,7 +229,7 @@ class wsPDFConvert $antialiasing = $antialiasing ? 'yes' : 'no'; $freetype = $texts ? 'yes' : 'no'; // Exporte les fichiers - $pdftoppm = new CubeIT_CommandLine('pdftoppm', null, true); + $pdftoppm = new CubeIT_CommandLine(self::PDFTOPPM, null, true); $pdftoppm->setPath(CONVERTER_PATH); $pdftoppm->setArg('f', $page); -- 2.39.5