From: Vincent Vanwaelscappel Date: Tue, 19 Apr 2022 10:55:38 +0000 (+0200) Subject: wip #5189 @0.25 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=8a63511222625005b3055ae2d09b16cc048c86a7;p=fluidbook_tools.git wip #5189 @0.25 --- diff --git a/.idea/deployment.xml b/.idea/deployment.xml index 2b6ae22..f722004 100644 --- a/.idea/deployment.xml +++ b/.idea/deployment.xml @@ -1,6 +1,7 @@ - + + \ No newline at end of file diff --git a/src/Document.php b/src/Document.php index 05fa003..09c2073 100644 --- a/src/Document.php +++ b/src/Document.php @@ -13,9 +13,12 @@ class Document extends \Cubist\PDF\Document * @param array $pages * @param bool $sync */ - public function processPages($files, $pages, $sync = false) + public function processPages($files, $pages = [], $sync = false) { start_measure('Process pages (doc)'); + if (!count($pages)) { + $pages = range(1, $this->getPages()); + } if (!$sync) { $pages = array_reverse($pages, true); } @@ -30,6 +33,11 @@ class Document extends \Cubist\PDF\Document return Files::mkdir(storage_path('fluidbook/convert/' . $this->getHash() . '/')); } + public function cleanConvertPath() + { + Files::rmdir($this->getConvertPath()); + } + /** * @param $page int * @param $dest string