Skip to content

Commit

Permalink
Merge pull request #282 from hansvn/master
Browse files Browse the repository at this point in the history
add DomPdf setOptions function to the Laravel Facade
  • Loading branch information
barryvdh authored Oct 31, 2016
2 parents 8d9f8e2 + 4f4c1e8 commit b049e8c
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/PDF.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
namespace Barryvdh\DomPDF;

use Dompdf\Dompdf;
use Dompdf\Options;
use Exception;
use Illuminate\Filesystem\Filesystem;
use Illuminate\Contracts\View\Factory as ViewFactory;
Expand Down Expand Up @@ -123,6 +124,18 @@ public function loadView($view, $data = array(), $mergeData = array(), $encoding
return $this->loadHTML($html, $encoding);
}

/**
* Set/Change an option in DomPdf
*
* @param array $options
* @return static
*/
public function setOptions(array $options) {
$options = new Options($options);
$this->dompdf->setOptions($options);
return $this;
}

/**
* Output the PDF as a string.
*
Expand Down

0 comments on commit b049e8c

Please sign in to comment.