\r
public function getInfos($in = null, $force = false)\r
{\r
- if(is_null($in)){\r
- $in=$this->in;\r
+ if (is_null($in)) {\r
+ $in = $this->in;\r
}\r
\r
$fwstk = new cubeCommandLine('fwstk');\r
public function globalOperations()\r
{\r
$this->getInfos();\r
- $this->CropAndCut();\r
- $this->getInfos($this->cropped, true);\r
- $this->getLinks();\r
- $this->getTexts();\r
+ if ($this->CropAndCut()) {\r
+ $this->getInfos($this->cropped, true);\r
+ }\r
+ $this->getLinksAndTexts();\r
}\r
\r
public function CropAndCut()\r
{\r
+ if (!$this->isCropped()) {\r
+ copy($this->in, $this->cropped);\r
+ return false;\r
+ }\r
if ($this->autocrop == 'trim') {\r
$this->trimDocument();\r
} else {\r
\r
if ($this->autocut) {\r
$this->cutDocument($this->autocut);\r
+ return true;\r
}\r
+ return false;\r
}\r
\r
public function cutDocument($mode)\r
}\r
}\r
\r
- public function getTexts()\r
+ public function getLinksAndTexts()\r
{\r
- $temp = cubeFiles::tempnam();\r
+ $fwstk = new cubeCommandLine('fwstk');\r
+ $fwstk->setPath(CONVERTER_PATH);\r
+ $fwstk->setArg('--input ' . $this->cropped);\r
+ $fwstk->setArg('--extractTexts ' . $this->out . 'p%d.txt');\r
+ $fwstk->setArg('--extractLinks ' . $this->out . 'p%d.csv');\r
+ $fwstk->execute();\r
+ $this->addToLog($fwstk);\r
+\r
+ /*$temp = cubeFiles::tempnam();\r
$pdftotext = new cubeCommandLine('pdftotext', null, true);\r
$pdftotext->setPath(CONVERTER_PATH);\r
$pdftotext->setArg('q');\r
file_put_contents($this->out . 'p' . $i . '.txt', $txt);\r
}\r
\r
- unlink($temp);\r
+ unlink($temp);*/\r
}\r
\r
public function makeMiniShot($page)\r
$this->addToLog($swfcombine);\r
}\r
\r
- protected function getLinks()\r
- {\r
- $fwstk = new cubeCommandLine('fwstk');\r
- $fwstk->setPath(CONVERTER_PATH);\r
- $fwstk->setArg('--input ' . $this->cropped);\r
- $fwstk->setArg('--extractLinks ' . $this->out . 'p%d.csv');\r
- $fwstk->execute();\r
- $this->addToLog($fwstk);\r
- }\r
-\r
protected function pdf2swfBarbare($page, $resolution = 150, $quality = 85, $method = 4)\r
{\r
// Fabrique les images\r