]> _ Git - fluidbook_processfarm.git/commitdiff
wip #7556 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 15 Jul 2025 14:18:47 +0000 (16:18 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 15 Jul 2025 14:18:47 +0000 (16:18 +0200)
app/process.php
app/src/PDFOperations.php

index 9a3e4b1293fec8d169d493f0f3009c56fb376cd0..6b076e6ab178374b1bc2cdeb130d0fe24b47e1c5 100644 (file)
@@ -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'])) {
index 567f23c927bd671636788dc476f52045276baf9b..540fcfec2f15f8ba025779a50fdc7bfd9d7d1c5c 100644 (file)
@@ -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