From d753291336a46eaf7318bda41ef8c6565ec3bf0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20B=C3=B8ndergaard?= Date: Wed, 25 May 2016 10:07:49 +0200 Subject: [PATCH] Add a config option for conversion script --- src/Laravel/LaravelServiceProvider.php | 4 ++++ src/config/config.php | 12 ++++++++++++ 2 files changed, 16 insertions(+) diff --git a/src/Laravel/LaravelServiceProvider.php b/src/Laravel/LaravelServiceProvider.php index 1358ecd..b6e93fd 100644 --- a/src/Laravel/LaravelServiceProvider.php +++ b/src/Laravel/LaravelServiceProvider.php @@ -30,6 +30,10 @@ public function register() $generator->setStoragePath($this->app['config']['phantom-pdf.temporary_file_path']); $generator->setTimeout($this->app['config']['phantom-pdf.timeout']); + if ($this->app['config']['phantom-pdf.conversion_script']) { + $generator->useScript($this->app['config']['phantom-pdf.conversion_script']); + } + foreach ($this->app['config']['phantom-pdf.command_line_options'] as $option) { $generator->addCommandLineOption($option); } diff --git a/src/config/config.php b/src/config/config.php index 79ef4c8..838324a 100644 --- a/src/config/config.php +++ b/src/config/config.php @@ -50,6 +50,18 @@ 'binary_path' => __DIR__ . '/../../bin/phantomjs', + /* + |-------------------------------------------------------------------------- + | Conversion Script + |-------------------------------------------------------------------------- + | + | The script used by PhantomJS to convert the page to PDF. If not set the + | default script will be used. + | + */ + + 'conversion_script' => null, + /* |-------------------------------------------------------------------------- | PhantomJS Command Line Options