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();
}