From: Vincent Vanwaelscappel Date: Tue, 15 Jul 2025 14:18:47 +0000 (+0200) Subject: wip #7556 @0.5 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=5ca06aeff01c9c11709fda34be05ae71866d7f84;p=fluidbook_processfarm.git wip #7556 @0.5 --- diff --git a/app/process.php b/app/process.php index 9a3e4b1..6b076e6 100644 --- a/app/process.php +++ b/app/process.php @@ -34,6 +34,8 @@ try { $res = PDFOperations::extractTexts($_POST['pdf'], $_POST['out'], $_POST['mode'] ?? 'standard', $_POST['method'] ?? 'fluidbook', $_POST['ignoreseparators'] ?? ''); } else if ($_POST['operation'] === 'extracthightlightsdata') { $res = PDFOperations::extractHighlightsData($_POST['pdf'], $_POST['out'], $_POST['mode'], $_POST['ignoreseparators']); + } else if ($_POST['operation'] === 'extractmarkdown') { + $res = PDFOperations::extractMarkdown($_POST['pdf'], $_POST['out']); } else { if (!isset($_POST['pdf'])) { if (isset($_POST['toolbox'])) { diff --git a/app/src/PDFOperations.php b/app/src/PDFOperations.php index 567f23c..540fcfe 100644 --- a/app/src/PDFOperations.php +++ b/app/src/PDFOperations.php @@ -72,4 +72,11 @@ class PDFOperations return $out; } + public static function extractMarkdown($pdf, $out) + { + PDFTools::extractMarkdown(Buffer::getIn($pdf), $out); + Buffer::syncOut(); + return $out; + } + } \ No newline at end of file