Skip to content

Commit

Permalink
Updates to release v1.0.5
Browse files Browse the repository at this point in the history
  • Loading branch information
kartik-v committed Oct 13, 2018
1 parent d00829e commit 908c8d1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
6 changes: 6 additions & 0 deletions CHANGE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
Change Log: `yii2-mpdf`
=======================

## Version 1.0.5

**Date:** 13-Oct-2018

- Correct `methods` parsing in output.

## Version 1.0.4

**Date:** 09-Oct-2018
Expand Down
13 changes: 7 additions & 6 deletions src/Pdf.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* @copyright Copyright © Kartik Visweswaran, Krajee.com, 2014 - 2018
* @package yii2-mpdf
* @version 1.0.4
* @version 1.0.5
*/

namespace kartik\mpdf;
Expand Down Expand Up @@ -258,11 +258,6 @@ public function initTempPaths()
*/
public function render()
{
if (!empty($this->methods)) {
foreach ($this->methods as $method => $param) {
$this->execute($method, $param);
}
}
return $this->output($this->content, $this->filename, $this->destination);
}

Expand Down Expand Up @@ -371,12 +366,18 @@ public function execute($method, $params = [])
* @param string $dest the output destination. Defaults to [[DEST_BROWSER]].
*
* @return mixed
* @throws InvalidConfigException
*/
public function output($content = '', $file = '', $dest = self::DEST_BROWSER)
{
$api = $this->getApi();
$css = $this->getCss();
$pdfAttachments = $this->getPdfAttachments();
if (!empty($this->methods)) {
foreach ($this->methods as $method => $param) {
$this->execute($method, $param);
}
}
if (!empty($css)) {
$api->WriteHTML($css, 1);
$api->WriteHTML($content, 2);
Expand Down

0 comments on commit 908c8d1

Please sign in to comment.