use Cubist\Util\Files\VirtualDirectory;
use Cubist\Util\PHP;
use Exception;
+use Fluidbook\Tools\Document;
use Fluidbook\Tools\Jobs\ProcessFile;
use Fluidbook\Tools\Jobs\ProcessPage;
-use Cubist\PDF\Document;
use Fluidbook\Tools\Search\SearchIndex;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldBeUnique;
--- /dev/null
+<?php
+
+namespace Fluidbook\Tools;
+
+use Fluidbook\Tools\Jobs\ProcessFile;
+use Fluidbook\Tools\Jobs\ProcessPage;
+
+class Document extends \Cubist\PDF\Document
+{
+ /**
+ * @param ProcessFile[] $files
+ * @param array $pages
+ * @param bool $sync
+ */
+ public function processPages($files, $pages, $sync = false)
+ {
+ start_measure('Process pages (doc)');
+ foreach ($pages as $i) {
+ $this->processPage($i, $files, $sync);
+ }
+ stop_measure('Process pages (doc)');
+ }
+
+ /**
+ * @param $page int
+ * @param $dest string
+ * @param $files ProcessFile[]
+ * @param false $sync
+ */
+ public function processPage($page, $files, $sync = false)
+ {
+ $dispatchFunction = $sync ? 'dispatchSync' : 'dispatch';
+ ProcessPage::$dispatchFunction($this, $page, $files);
+ }
+}
namespace Fluidbook\Tools\Jobs;
use Cubist\Util\Files\Files;
-use Cubist\PDF\Document;
+use Fluidbook\Tools\Document;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;