]> _ Git - fluidbook_processfarm.git/commitdiff
wip #5220 @2
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 17 May 2022 15:08:06 +0000 (17:08 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 17 May 2022 15:08:06 +0000 (17:08 +0200)
src/Process.php

index 6115f0dca92cdafcca97c690ac8c651802462d48..3ab93657da065c836ae13ccbb4a759327fee32b2 100644 (file)
@@ -2,7 +2,9 @@
 
 namespace Fluidbook\Farmer;
 
+use Fluidbook\Tools\Document;
 use Fluidbook\Tools\Jobs\ProcessFile;
+use Fluidbook\Tools\Jobs\ProcessPage;
 
 class Process extends ProcessFile
 {
@@ -15,6 +17,7 @@ class Process extends ProcessFile
     protected $mobileRatio = 1;
     protected $resolutionRatio = 1;
     protected $filespath;
+    protected $_job = null;
 
     public function __construct($out, $page, $resolutionRatio, $mobileRatio, $format = 'jpg', $resolution = 150, $withGraphics = true, $withTexts = true, $version = 'html', $force = false)
     {
@@ -111,4 +114,12 @@ class Process extends ProcessFile
         return str_replace(self::LOCAL_ROOT, self::DISTANT_ROOT, $this->getPath($this->isForce()));
     }
 
+    public function getJob(): ProcessPage
+    {
+        if (null === $this->job) {
+            $this->job = new ProcessPage(new Document($this->getOut() . '/original.pdf'), $this->getPage());
+        }
+        return parent::getJob();
+    }
+
 }
\ No newline at end of file