From 5ca06aeff01c9c11709fda34be05ae71866d7f84 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Tue, 15 Jul 2025 16:18:47 +0200 Subject: [PATCH] wip #7556 @0.5 --- app/process.php | 2 ++ app/src/PDFOperations.php | 7 +++++++ 2 files changed, 9 insertions(+) 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 -- 2.39.5