From 8a63511222625005b3055ae2d09b16cc048c86a7 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Tue, 19 Apr 2022 12:55:38 +0200 Subject: [PATCH] wip #5189 @0.25 --- .idea/deployment.xml | 8 ++++++-- .idea/misc.xml | 5 +++++ src/Document.php | 10 +++++++++- 3 files changed, 20 insertions(+), 3 deletions(-) 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 -- 2.39.5