From: Vincent Vanwaelscappel Date: Tue, 17 May 2022 15:08:06 +0000 (+0200) Subject: wip #5220 @2 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=3aae6a23bfd22c8bb79275588fea44b68564bfd7;p=fluidbook_processfarm.git wip #5220 @2 --- diff --git a/src/Process.php b/src/Process.php index 6115f0d..3ab9365 100644 --- a/src/Process.php +++ b/src/Process.php @@ -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