From 0324e86b9383494deaf84d57af14ced31dd1d979 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Tue, 29 Jul 2025 14:18:27 +0200 Subject: [PATCH] wip #7556 @1 --- src/PDFTools.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/PDFTools.php b/src/PDFTools.php index 1019eb1..948d1d4 100644 --- a/src/PDFTools.php +++ b/src/PDFTools.php @@ -596,11 +596,16 @@ class PDFTools public static function extractMarkdown($pdf, $out) { + $dir = Files::mkdir($out . '/docling'); $docling = new CommandLine('python'); $docling->setArg(null, self::resource_path('tools/docling/convert_page.py')); $docling->setArg(null, $pdf); - $docling->setArg(null, Files::mkdir($out . '/docling')); + $docling->setArg(null, $dir); $docling->execute(); + if (!file_exists($dir . 'p1.md')) { + throw new \Exception('An error occured during docling process : ' . $docling->getOutput() . ' // ' . $docling->getCommand()); + } + $docling->debug(); } -- 2.39.5