From 2f9bdc935d64e923d2cc0f174c16b236bede0b70 Mon Sep 17 00:00:00 2001 From: kevin_fourie Date: Thu, 28 Feb 2008 11:09:29 +0000 Subject: [PATCH] Merged in from DEV trunk... --- search2/indexing/extractors/PDFExtractor.inc.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+), 0 deletions(-) diff --git a/search2/indexing/extractors/PDFExtractor.inc.php b/search2/indexing/extractors/PDFExtractor.inc.php index 6d9b83a..d4e8d97 100644 --- a/search2/indexing/extractors/PDFExtractor.inc.php +++ b/search2/indexing/extractors/PDFExtractor.inc.php @@ -50,6 +50,26 @@ class PDFExtractor extends ApplicationExtractor { return array('application/pdf'); } + + protected function filter($text) + { + return $text; + } + + protected function exec($cmd) + { + $res = parent::exec($cmd); + + if (false === $res && (strpos($this->output, 'Copying of text from this document is not allowed') !== false)) + { + $this->output = ''; + file_put_contents($this->targetfile, _kt('Security properties on the PDF document prevent text from being extracted.')); + return true; + } + + return $res; + + } } ?> \ No newline at end of file -- libgit2 0.21.4