From c5c552ff6bed5418d991afa1931d921bc075823e Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Fri, 26 Feb 2010 16:45:04 +0000 Subject: [PATCH] --- inc/ws/Metier/class.ws.document.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/inc/ws/Metier/class.ws.document.php b/inc/ws/Metier/class.ws.document.php index 9256aee51..16eea7518 100644 --- a/inc/ws/Metier/class.ws.document.php +++ b/inc/ws/Metier/class.ws.document.php @@ -23,6 +23,7 @@ class wsDocument extends cubeMetier { protected $out; protected $in; + protected $uncompressed; protected $log; protected $log_pointer; protected $infos; @@ -46,6 +47,7 @@ class wsDocument extends cubeMetier { $this->out = ROOT . '/docs/' . $this->document_id . '/'; $this->log = $this->out . 'log.txt'; $this->in = $this->out . 'original.pdf'; + $this->uncompressed = $this->out . 'uncompressed.pdf'; $this->infos = $this->out . 'infos.txt'; $this->textes = $this->out . 'textes.txt'; $this->phperrors = $this->out . 'php.err'; @@ -60,6 +62,16 @@ class wsDocument extends cubeMetier { public function copyOriginal($tmp_file) { move_uploaded_file($tmp_file, $this->in); + $this->uncompress(); + } + + public function uncompress() + { + $pdftk = new cubeCommandLine('pdftk'); + $pdftk->setPath(CONVERTER_PATH); + $pdftk->setManualArg($this->in . ' output ' . $this->uncompressed . ' uncompress '); + $pdftk->execute(); + $this->addToLog($pdftk); } public function getInfos() -- 2.39.5