Skip to content

Commit

Permalink
saving refactored
Browse files Browse the repository at this point in the history
  • Loading branch information
castamir committed Jun 12, 2014
1 parent d005411 commit 451649b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
8 changes: 3 additions & 5 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ PDF Response for Nette 2
===

- sends template as PDF output
- mPDF required - http://www.mpdf1.com/mpdf/download (version 5.*)
- works fine with both Nette 2.0.* and Nette 2.1.* and even Nette 2.2.*
- no js support
- nice api
Expand Down Expand Up @@ -140,9 +139,8 @@ Create pdf with latte only
$this->sendResponse($pdf);
}

More info
See also
---

- http://forum.nette.org/cs/9037-zkusenosti-s-pouzitim-pdfresponse-v-nette-2-0b-a-php-5-3
- http://forum.nette.org/cs/3726-addon-pdfresponse-pdfresponse
- http://nette.merxes.cz/addons/castamir/pdfresponse2
- [Nette forum](http://forum.nette.org/cs/3726-addon-pdfresponse-pdfresponse) (czech)
- [Nette Addons](http://addons.nette.org/joseki/pdf-response)
5 changes: 2 additions & 3 deletions src/Joseki/Application/Responses/PdfResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -330,11 +330,10 @@ public function createMPDF()
*/
public function save($dir, $filename = NULL)
{
$pdf = $this->build();
$file = $pdf->output($filename, "S");
$content = $this->__toString();
$filename = Strings::webalize($filename ? : $this->documentTitle) . ".pdf";

file_put_contents($dir . $filename, $file);
file_put_contents($dir . $filename, $content);

return $dir . $filename;
}
Expand Down

0 comments on commit 451649b

Please sign in to comment.