From 030b4894ed990c8ad10d15ab1f2a04320150d992 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Thu, 7 Sep 2023 16:34:37 +0200 Subject: [PATCH] wip #6188 @0.5 --- src/PDFTools.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/PDFTools.php b/src/PDFTools.php index 60d98f7..9740485 100644 --- a/src/PDFTools.php +++ b/src/PDFTools.php @@ -442,6 +442,15 @@ class PDFTools public static function extractTexts($pdf, $out, $mode = 'standard', $textExtraction = 'fluidbook', $ignoreSeparators = '') { $out .= 'texts'; + + if (!$mode) { + $mode = 'standard'; + } + if ($mode === 'robust') { + $textExtraction = 'fluidbook'; + $ignoreSeparators = ""; + } + if ($ignoreSeparators) { $out .= '/sep_' . md5($ignoreSeparators); } @@ -452,6 +461,8 @@ class PDFTools $fwstk->setArg('--extractTexts ' . $out . '%s%d.txt'); $fwstk->setArg('--extractTextsMethod ' . $textExtraction); $fwstk->setArg('--threads 1'); + $fwstk->setArg('--mode ' . $mode); + if ($ignoreSeparators) { $fwstk->setArg('--ignoreSeparators "' . $ignoreSeparators . '"'); } -- 2.39.5