]> _ Git - fluidbook_processfarm.git/commitdiff
wip #5524 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 22 Feb 2023 09:23:11 +0000 (10:23 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 22 Feb 2023 09:23:11 +0000 (10:23 +0100)
app/process.php
app/src/Document.php [new file with mode: 0644]
app/src/ProcessToolboxDocumentFile.php
app/src/ProcessToolboxPDFFile.php
update

index 0dcc04e622bbe38510c9994992c9427e4b7ff6b3..5c7c02a2456a1a4b204d54e858aecb6c29e82283 100644 (file)
@@ -15,6 +15,8 @@ if (!isset($_POST['pdf'])) {
        }
        $p = new $class($_POST['out'], $_POST['page'], $_POST['resolutionRatio'], $_POST['mobileRatio'], $_POST['format'], $_POST['resolution'], $_POST['withGraphics'], $_POST['withText'], $_POST['version'], $_POST['force']);
 } else {
-       $p = new ProcessToolboxPDFFile($_POST['pdf'], $_POST['out'], $_POST['page'], $_POST['resolutionRatio'], $_POST['mobileRatio'], $_POST['format'], $_POST['resolution'], $_POST['withGraphics'], $_POST['withText'], $_POST['version'], $_POST['force']);
+       $p = new ProcessToolboxPDFFile($_POST['pdf'], $_POST['out'], $_POST['page'], $_POST['format'], $_POST['resolution'], $_POST['withGraphics'], $_POST['withText'], $_POST['version'], $_POST['force']);
 }
-die($p->process());
\ No newline at end of file
+$res = $p->process();
+error_log($res);
+die($res);
\ No newline at end of file
diff --git a/app/src/Document.php b/app/src/Document.php
new file mode 100644 (file)
index 0000000..4c33350
--- /dev/null
@@ -0,0 +1,21 @@
+<?php
+
+namespace Fluidbook\Farmer;
+
+
+use Cubist\Util\Files\Files;
+
+class Document extends \Cubist\PDF\Document {
+
+       /** @var string */
+       protected $_out;
+
+       public function __construct($in, $out) {
+               $this->_out = $out;
+               parent::__construct($in);
+       }
+
+       public function getConvertPath(): string {
+               return Files::mkdir($this->_out);
+       }
+}
\ No newline at end of file
index 44763137b03af5c759d30295d978c775e48bae36..5ef2aff89cd4d864c06eca0c432fd430cda163f7 100644 (file)
@@ -5,10 +5,10 @@ namespace Fluidbook\Farmer;
 
 class ProcessToolboxDocumentFile extends ProcessFile{
        public function getOut() {
-               $this->getDistantOut();
+               return $this->getDistantOut();
        }
 
        public function process() {
-               $this->getPath($this->isForce());
+               return $this->getPath($this->isForce());
        }
 }
\ No newline at end of file
index baa8fd1071d9b71ccf975da931b375f41773db0f..99ed688901337e175289afb75c7cf9aada2edb8a 100644 (file)
@@ -10,9 +10,10 @@ class ProcessToolboxPDFFile extends ProcessToolboxDocumentFile {
         */
        protected $_pdf;
 
-       public function __construct($pdf, $out, $page, $resolutionRatio, $mobileRatio, $format = 'jpg', $resolution = 150, $withGraphics = true, $withTexts = true, $version = 'html', $force = false) {
+       public function __construct($pdf, $out, $page, $format = 'jpg', $resolution = 150, $withGraphics = true, $withTexts = true, $version = 'html', $force = false) {
                $this->setPdf($pdf);
-               parent::__construct($out, $page, $resolutionRatio, $mobileRatio, $format, $resolution, $withGraphics, $withTexts, $version, $force);
+               $document = new Document($pdf, $out);
+               parent::__construct($out, $page, $document->getResolutionRatio(), $document->getMobileFirstRatio(), $format, $resolution, $withGraphics, $withTexts, $version, $force);
        }
 
        /**
diff --git a/update b/update
index c2b29c169a2225792ff6b612afda201939851740..695faa08f8bc09a14c09fea90697746858265cd8 100755 (executable)
--- a/update
+++ b/update
@@ -7,6 +7,7 @@ git reset --hard origin/master
 git stash
 git pull origin master
 chmod 755 /docker/fluidbook-processfarm/app/bin/*
+chmod 755 /docker/fluidbook-processfarm/app/vendor/cubist/pdf/resources/tools/fwstk.sh
 chmod 755 /docker/fluidbook-processfarm/ssh
 chmod 600 /docker/fluidbook-processfarm/ssh/id_rsa
 DOCKER_BUILDKIT=1 docker compose build