]> _ Git - cubeextranet.git/commitdiff
(no commit message)
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Fri, 26 Feb 2010 16:45:04 +0000 (16:45 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Fri, 26 Feb 2010 16:45:04 +0000 (16:45 +0000)
inc/ws/Metier/class.ws.document.php

index 9256aee510e2008ebba0bf1b9365f2023f608e42..16eea751855499c4bf0df63487fe0a1cd8a624da 100644 (file)
@@ -23,6 +23,7 @@ class wsDocument extends cubeMetier {
 \r
        protected $out;\r
        protected $in;\r
+       protected $uncompressed;\r
        protected $log;\r
        protected $log_pointer;\r
        protected $infos;\r
@@ -46,6 +47,7 @@ class wsDocument extends cubeMetier {
                $this->out = ROOT . '/docs/' . $this->document_id . '/';\r
                $this->log = $this->out . 'log.txt';\r
                $this->in = $this->out . 'original.pdf';\r
+               $this->uncompressed = $this->out . 'uncompressed.pdf';\r
                $this->infos = $this->out . 'infos.txt';\r
                $this->textes = $this->out . 'textes.txt';\r
                $this->phperrors = $this->out . 'php.err';\r
@@ -60,6 +62,16 @@ class wsDocument extends cubeMetier {
        public function copyOriginal($tmp_file)\r
        {\r
                move_uploaded_file($tmp_file, $this->in);\r
+               $this->uncompress();\r
+       }\r
+\r
+       public function uncompress()\r
+       {\r
+               $pdftk = new cubeCommandLine('pdftk');\r
+               $pdftk->setPath(CONVERTER_PATH);\r
+               $pdftk->setManualArg($this->in . ' output ' . $this->uncompressed . ' uncompress ');\r
+               $pdftk->execute();\r
+               $this->addToLog($pdftk);\r
        }\r
 \r
        public function getInfos()\r