From: Vincent Vanwaelscappel Date: Wed, 23 Feb 2022 15:01:27 +0000 (+0100) Subject: wip #5122 @0:10 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=bc1c5862d3389fc507d22bbde9a476ac193635d9;p=cubist_minisearch.git wip #5122 @0:10 --- diff --git a/src/Document/PDF.php b/src/Document/PDF.php index e520da7..73af696 100644 --- a/src/Document/PDF.php +++ b/src/Document/PDF.php @@ -17,7 +17,7 @@ class PDF extends Document if (!class_exists(\Cubist\PDF\PDFTools::class)) { throw new \Exception('Package cubist/pdf is required in order to index PDF documents'); } - $this->file=$file; + $this->file = $file; } public function process() @@ -34,6 +34,10 @@ class PDF extends Document $page = $base; $page['id'] .= '#page=' . $i; $page['url'] .= '#page=' . $i; + if ($page['id'] != 1) { + $page['displayedTitle'] .= ' - Page ' . $i; + $page['title'] = ''; + } $page['text'] = file_get_contents($doc->getConvertPath() . '/texts/fp' . $i . '.txt'); $res[] = $page; }