protected function exec($cmd)
 {
     global $default;
     $res = parent::exec($cmd);
     if (false === $res && (strpos($this->output, 'Copying of text from this document is not allowed') !== false || strpos($this->output, 'Incorrect password') !== false)) {
         $this->output = '';
         file_put_contents($this->targetfile, _kt('Security properties on the PDF document prevent text from being extracted.'));
         $default->log->info('Security properties on the PDF document prevent text from being extracted.');
         return true;
     }
     if (false === $res && strpos($this->output, 'PDF file is damaged') !== false) {
         $this->output = '';
         $default->log->info('PDF file is damaged');
         return true;
     }
     if (false === $res && strpos($this->output, '(continuing anyway)') !== false) {
         $this->output = '';
         return true;
     }
     if (false === $res && strpos($this->output, 'font') !== false) {
         $this->output = '';
         return true;
     }
     if (filesize($this->targetfile) > 0) {
         $this->output = '';
         return true;
     }
     return $res;
 }
 public function diagnose()
 {
     if (OS_WINDOWS) {
         // pstotext is not available under windows, so no need to diagnose it
         return null;
     }
     return parent::diagnose();
 }
Example #3
0
 public function diagnose()
 {
     // no rpm's available for pstotext, removing the diagnose for it so it doesn't prevent the indexing from running
     return null;
     if (OS_WINDOWS) {
         // pstotext is not available under windows, so no need to diagnose it
         return null;
     }
     return parent::diagnose();
 }