PDFTools::extractHighlightsData($this->getPDFInput(), $this->getConvertPath());
}
- public function processFullTexts()
+ public function processFullTexts($force = true)
{
- PDFTools::extractTexts($this->getPDFInput(), $this->getConvertPath());
+ PDFTools::extractTexts($this->getPDFInput(), $this->getConvertPath(), '', $force);
}
public function getPageNumbers()
$fwstk->execute();
}
- public static function extractTexts($pdf, $out, $ignoreSeparators = '')
+ public static function extractTexts($pdf, $out, $ignoreSeparators = '', $force = true)
{
$out .= 'texts/';
Files::mkdir($out);
+ if (!$force && file_exists($out . 'fp1.txt')) {
+ return;
+ }
+
$fwstk = new FWSTK();
$fwstk->setArg('--input ' . $pdf);
$fwstk->setArg('--extractTexts ' . $out . '%s%d.txt');