From eeadecebc7cd21b7d4e592c020ee8b98a6f8bae7 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Thu, 15 Jan 2026 15:07:37 +0100 Subject: [PATCH] wip #7894 @0.25 --- src/CommandLine/Docling.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/CommandLine/Docling.php b/src/CommandLine/Docling.php index c642749..73bebbc 100644 --- a/src/CommandLine/Docling.php +++ b/src/CommandLine/Docling.php @@ -15,7 +15,7 @@ class Docling extends CommandLine parent::__construct('docling', $output, $error, $outputPrefix); } - public static function OCR($image, $locale = null) + public static function OCR($image, $locale = null, $returnFile = false) { $f = new \SplFileInfo($image); @@ -36,8 +36,11 @@ class Docling extends CommandLine $html = Markdown::toHTML($md, false); file_put_contents($out, $html); - return $html; } - return file_get_contents($out); + if ($returnFile) { + return $out; + } else { + return $html ?? file_get_contents($out); + } } } \ No newline at end of file -- 2.39.5