From: Vincent Vanwaelscappel Date: Wed, 20 Sep 2023 08:53:18 +0000 (+0200) Subject: wip #6296 @0.25 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=18ea61e6d8b551748aaecab8be9cde4b280677b7;p=fluidbook_processfarm.git wip #6296 @0.25 --- diff --git a/app/process.php b/app/process.php index 1e212b4..329fc33 100644 --- a/app/process.php +++ b/app/process.php @@ -7,17 +7,21 @@ use Fluidbook\Farmer\ProcessToolboxPDFFile; require_once __DIR__ . "/vendor/autoload.php"; if (!isset($_POST['quality'])) { - $_POST['quality'] = 85; + $_POST['quality'] = 85; } -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']); - } 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']); - } -} 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']); -} -$res = $p->process(); -die($res); \ No newline at end of file +try { + 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']); + } 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']); + } + } 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']); + } + $res = $p->process(); + die($res); +} catch (Exception $e) { + die($e->getMessage()); +} \ No newline at end of file