Skip to content

Commit

Permalink
Add a config option for conversion script
Browse files Browse the repository at this point in the history
  • Loading branch information
danielboendergaard committed May 25, 2016
1 parent ce653ba commit d753291
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Laravel/LaravelServiceProvider.php
Expand Up @@ -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);
}
Expand Down
12 changes: 12 additions & 0 deletions src/config/config.php
Expand Up @@ -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
Expand Down

0 comments on commit d753291

Please sign in to comment.