]> _ Git - fluidbook_tools.git/commitdiff
wip #5184 @1
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 29 Mar 2022 10:51:58 +0000 (12:51 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 29 Mar 2022 10:51:58 +0000 (12:51 +0200)
src/Compiler/Compiler.php
src/Document.php

index 57fd9df5470049b5212f47f73330134c2886f251..76e4b5acd60b5edd050ab77ef5e37a44e60dec02 100644 (file)
@@ -15,6 +15,7 @@ use Illuminate\Contracts\Queue\ShouldBeUnique;
 use Illuminate\Contracts\Queue\ShouldQueue;
 use Illuminate\Foundation\Bus\Dispatchable;
 use Illuminate\Queue\InteractsWithQueue;
+use Illuminate\Queue\Jobs\Job;
 use Illuminate\Queue\Jobs\SyncJob;
 use Illuminate\Queue\SerializesModels;
 use JsonException;
@@ -65,6 +66,7 @@ class Compiler implements ShouldQueue, ShouldBeUnique
      */
     protected $resolutions = [150, 300];
 
+
     public function addSource($document, $start = 1, $pages = null)
     {
         $source = new Source(new Document($document), $start, $pages);
@@ -93,6 +95,9 @@ class Compiler implements ShouldQueue, ShouldBeUnique
         }
 
         start_measure('Process Fluidbook');
+        // Launch async conversion of pages. Some pages will be processed while the following sync process will attempt other conversion
+        $this->processPages(false);
+        //
         $this->processPages($sync);
         $this->getTexts();
         $this->compileFluidbook();
index bb2f5f7edcdd131656a70cea7310f194ac83ec94..6086d7b70cd067afe0dac75d84d4acadb2cc1740 100644 (file)
@@ -32,10 +32,11 @@ class Document extends \Cubist\PDF\Document
      * @param $dest string
      * @param $files ProcessFile[]
      * @param false $sync
+     * @return ProcessPage
      */
     public function processPage($page, $files, $sync = false)
     {
         $dispatchFunction = $sync ? 'dispatchSync' : 'dispatch';
-        ProcessPage::$dispatchFunction($this, $page, $files);
+        return ProcessPage::$dispatchFunction($this, $page, $files);
     }
 }