]> _ Git - cubist_pdf.git/commitdiff
wip #8048
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 17 Mar 2026 11:46:16 +0000 (12:46 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 17 Mar 2026 11:46:16 +0000 (12:46 +0100)
src/PDFTools.php

index 1125631ad25a7e2030998622260a727c6984059f..93ac695cc8ba7e5c4690b0012cbe32d525e8c5a8 100644 (file)
@@ -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());
         }
     }