From ef8b63e7c4c8b8c55bc8bba5cf815b8169f3ed5d Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Tue, 18 Feb 2025 19:48:38 +0100 Subject: [PATCH] #7340 --- app/process.php | 6 ++-- app/src/ProcessToolboxPDFFile.php | 48 +++++++++++++++++-------------- 2 files changed, 29 insertions(+), 25 deletions(-) diff --git a/app/process.php b/app/process.php index 0f18bff..9a3e4b1 100644 --- a/app/process.php +++ b/app/process.php @@ -37,12 +37,12 @@ try { } else { if (!isset($_POST['pdf'])) { if (isset($_POST['toolbox'])) { - $p = new ProcessToolboxDocumentFile($_POST['out'], $_POST['page'], $_POST['resolutionRatio'], $_POST['mobileRatio'], $_POST['format'], $_POST['resolution'], (int)$_POST['quality'], $_POST['withGraphics'], $_POST['withText'], $_POST['version'], $_POST['force']); + $p = new ProcessToolboxDocumentFile($_POST['out'], $_POST['page'], $_POST['resolutionRatio'], $_POST['mobileRatio'], $_POST['format'], $_POST['resolution'], (int)$_POST['quality'], $_POST['withGraphics'], $_POST['withText'], $_POST['transparent'], $_POST['version'], $_POST['force']); } else { - $p = new ProcessFile($_POST['out'], $_POST['page'], $_POST['resolutionRatio'], $_POST['mobileRatio'], $_POST['format'], $_POST['resolution'], (int)$_POST['quality'], $_POST['withGraphics'], $_POST['withText'], $_POST['version'], $_POST['force']); + $p = new ProcessFile($_POST['out'], $_POST['page'], $_POST['resolutionRatio'], $_POST['mobileRatio'], $_POST['format'], $_POST['resolution'], (int)$_POST['quality'], $_POST['withGraphics'], $_POST['withText'], $_POST['transparent'], $_POST['version'], $_POST['force']); } } else { - $p = new ProcessToolboxPDFFile($_POST['pdf'], $_POST['out'], $_POST['page'], $_POST['format'], $_POST['resolution'], (int)$_POST['quality'], $_POST['withGraphics'], $_POST['withText'], $_POST['version'], $_POST['force']); + $p = new ProcessToolboxPDFFile($_POST['pdf'], $_POST['out'], $_POST['page'], $_POST['format'], $_POST['resolution'], (int)$_POST['quality'], $_POST['withGraphics'], $_POST['withText'], $_POST['transparent'], $_POST['version'], $_POST['force']); } $res = $p->process(); } diff --git a/app/src/ProcessToolboxPDFFile.php b/app/src/ProcessToolboxPDFFile.php index b3fc5c4..86471b4 100644 --- a/app/src/ProcessToolboxPDFFile.php +++ b/app/src/ProcessToolboxPDFFile.php @@ -3,30 +3,34 @@ namespace Fluidbook\Farmer; -class ProcessToolboxPDFFile extends ProcessToolboxDocumentFile { +class ProcessToolboxPDFFile extends ProcessToolboxDocumentFile +{ - /** - * @var string - */ - protected $_pdf; + /** + * @var string + */ + protected $_pdf; - public function __construct($pdf, $out, $page, $format = 'jpg', $resolution = 150, $quality = 85, $withGraphics = true, $withTexts = true, $version = 'html', $force = false) { - $this->setPdf($pdf); - $document = new Document($pdf, $out); - parent::__construct($out, $page, $document->getResolutionRatio(), $document->getMobileFirstRatio(), $format, $resolution, $quality, $withGraphics, $withTexts, $version, $force); - } + public function __construct($pdf, $out, $page, $format = 'jpg', $resolution = 150, $quality = 85, $withGraphics = true, $withTexts = true, $transparent = false, $version = 'html', $force = false) + { + $this->setPdf($pdf); + $document = new Document($pdf, $out); + parent::__construct($out, $page, $document->getResolutionRatio(), $document->getMobileFirstRatio(), $format, $resolution, $quality, $withGraphics, $withTexts, $transparent, $version, $force); + } - /** - * @return string - */ - public function getPdf(): string|null { - return $this->_pdf; - } + /** + * @return string + */ + public function getPdf(): string|null + { + return $this->_pdf; + } - /** - * @param string $pdf - */ - public function setPdf(string $pdf): void { - $this->_pdf = $pdf; - } + /** + * @param string $pdf + */ + public function setPdf(string $pdf): void + { + $this->_pdf = $pdf; + } } \ No newline at end of file -- 2.39.5