Commit 2f9bdc935d64e923d2cc0f174c16b236bede0b70

Authored by kevin_fourie
1 parent 78ec6b2c

Merged in from DEV trunk...

KTC-398
"Security properties on the PDF document prevent text from being extracted."
Fixed.

Committed By: Conrad Vermeulen
Reviewed By: Megan Watson

git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/STABLE/trunk@8184 c91229c3-7414-0410-bfa2-8a42b809f60b
search2/indexing/extractors/PDFExtractor.inc.php
... ... @@ -50,6 +50,26 @@ class PDFExtractor extends ApplicationExtractor
50 50 {
51 51 return array('application/pdf');
52 52 }
  53 +
  54 + protected function filter($text)
  55 + {
  56 + return $text;
  57 + }
  58 +
  59 + protected function exec($cmd)
  60 + {
  61 + $res = parent::exec($cmd);
  62 +
  63 + if (false === $res && (strpos($this->output, 'Copying of text from this document is not allowed') !== false))
  64 + {
  65 + $this->output = '';
  66 + file_put_contents($this->targetfile, _kt('Security properties on the PDF document prevent text from being extracted.'));
  67 + return true;
  68 + }
  69 +
  70 + return $res;
  71 +
  72 + }
53 73 }
54 74  
55 75 ?>
56 76 \ No newline at end of file
... ...