]> _ Git - fluidbook_processfarm.git/commitdiff
wip #7684
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 7 Aug 2025 13:52:23 +0000 (15:52 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 7 Aug 2025 13:52:23 +0000 (15:52 +0200)
app/bin/mount
app/process.php
app/src/PDFOperations.php

index 5e4bee7c44dc942ca3ff50bc70bcd73c5353fd4c..8cfd31d1077ccc996993a3e292c0e60acba4dc5c 100755 (executable)
@@ -27,6 +27,13 @@ else
      sshfs -o reconnect,ServerAliveInterval=15,ServerAliveCountMax=3 -p 7554 -o uid=33 -o gid=33 -o allow_other fluidbook@pdfcache.toolbox.fluidbook.com:/data /application/protected/fluidbookpublication/cache/pdffiles
 fi
 
+mkdir -p /application/protected/fluidbookpublication/cache/zoomarea
+if mountpoint -q "/application/protected/fluidbookpublication/cache/zoomarea"; then
+    :
+else
+     sshfs -o reconnect,ServerAliveInterval=15,ServerAliveCountMax=3 -p 7584 -o uid=33 -o gid=33 -o allow_other fluidbook@zoomareacache.toolbox.fluidbook.com:/data /application/protected/fluidbookpublication/cache/zoomarea
+fi
+
 mkdir -p /application/protected/fluidbookpublication/working
 if mountpoint -q "/application/protected/fluidbookpublication/working"; then
     :
index fe98af13932abf468039b0c375b8aa9cab9a06d7..424621d90accddbc7df8522dc4d14738a91eb8f9 100644 (file)
@@ -36,6 +36,8 @@ try {
         $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 ($_POST['operation'] === 'extractpdfarea') {
+        $res = PDFOperations::extractArea($_POST['pdf'], $_POST['out'],$_POST['page'], $_POST['area'], $_POST['options']);
     } else {
         if (!isset($_POST['pdf'])) {
             if (isset($_POST['toolbox'])) {
index 540fcfec2f15f8ba025779a50fdc7bfd9d7d1c5c..8a433dd7ae1e7cf67a0b1d57122113a55e463706 100644 (file)
@@ -4,6 +4,7 @@ namespace Fluidbook\Farmer;
 
 use Cubist\PDF\CommandLine\FWSTK;
 use Cubist\PDF\PDFTools;
+use Cubist\Util\Graphics\PDF;
 
 class PDFOperations
 {
@@ -79,4 +80,11 @@ class PDFOperations
         return $out;
     }
 
+    public static function extractArea($pdf, $cache, $page, $rect, $options)
+    {
+        $out = PDF::extractArea(Buffer::getIn($pdf), $page, $rect, null, $options, $cache);
+        Buffer::syncOut();
+        return $out;
+    }
+
 }
\ No newline at end of file