From cccdc468bce4346ab34c3ca91d9b8daa4a445acb Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Tue, 17 Mar 2026 12:46:16 +0100 Subject: [PATCH] wip #8048 --- src/PDFTools.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/PDFTools.php b/src/PDFTools.php index 1125631..93ac695 100644 --- a/src/PDFTools.php +++ b/src/PDFTools.php @@ -592,15 +592,16 @@ class PDFTools /** * @throws \Exception */ - public static function extractMarkdown($pdf, $out) + public static function extractMarkdown($pdf, $out, $filename = "document.md") { $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, $dir); + $docling->setArg(null, $filename); $docling->execute(); - if (!file_exists($dir . 'p1.md')) { + if (!file_exists($dir . '/' . $filename)) { throw new \Exception('An error occured during docling process : ' . $docling->getCommand() . ' // ' . $docling->getOutput()); } } -- 2.39.5