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