From: Vincent Vanwaelscappel Date: Wed, 22 Feb 2023 07:27:27 +0000 (+0100) Subject: wip #5524 @0.5 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=a7ce3eae4462347d9ae238705e44df7360d6862c;p=fluidbook_processfarm.git wip #5524 @0.5 --- diff --git a/app/process.php b/app/process.php index 87ab21c..0dcc04e 100644 --- a/app/process.php +++ b/app/process.php @@ -1,15 +1,20 @@ process()); \ No newline at end of file diff --git a/app/src/ProcessFile.php b/app/src/ProcessFile.php index c9eeb66..424737a 100644 --- a/app/src/ProcessFile.php +++ b/app/src/ProcessFile.php @@ -131,10 +131,14 @@ class ProcessFile extends \Fluidbook\Tools\Jobs\ProcessFile { } } + public function getPdf(): string { + return Files::firstThatExists($this->getOut() . '/crop.pdf', $this->getOut() . '/fixed.pdf', $this->getOut() . '/original.pdf'); + } + public function getSplittedPDFPage() { $res = $this->getOut() . 'pdf/p' . $this->getPage() . '.pdf'; if (!file_exists($res)) { - PDFTools::split(Files::firstThatExists($this->getOut() . '/crop.pdf', $this->getOut() . '/fixed.pdf', $this->getOut() . '/original.pdf'), $this->getOut() . '/pdf'); + PDFTools::split($this->getPdf(), $this->getOut() . '/pdf'); } return $res; } diff --git a/app/src/ProcessFileNoMapping.php b/app/src/ProcessFileNoMapping.php deleted file mode 100644 index d48c05e..0000000 --- a/app/src/ProcessFileNoMapping.php +++ /dev/null @@ -1,14 +0,0 @@ -getDistantOut(); - } - - public function process() { - $this->getPath($this->isForce()); - } -} \ No newline at end of file diff --git a/app/src/ProcessToolboxDocumentFile.php b/app/src/ProcessToolboxDocumentFile.php new file mode 100644 index 0000000..4476313 --- /dev/null +++ b/app/src/ProcessToolboxDocumentFile.php @@ -0,0 +1,14 @@ +getDistantOut(); + } + + public function process() { + $this->getPath($this->isForce()); + } +} \ No newline at end of file diff --git a/app/src/ProcessToolboxPDFFile.php b/app/src/ProcessToolboxPDFFile.php new file mode 100644 index 0000000..baa8fd1 --- /dev/null +++ b/app/src/ProcessToolboxPDFFile.php @@ -0,0 +1,31 @@ +setPdf($pdf); + parent::__construct($out, $page, $resolutionRatio, $mobileRatio, $format, $resolution, $withGraphics, $withTexts, $version, $force); + } + + /** + * @return string + */ + public function getPdf(): string { + return $this->_pdf; + } + + /** + * @param string $pdf + */ + public function setPdf(string $pdf): void { + $this->_pdf = $pdf; + } +} \ No newline at end of file