Created
July 28, 2014 17:08
-
-
Save carlosfilho88/40501eb8cd32f94a5cef to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Application_Model_MPDF { | |
public function createPDF($HTML, $filename) { | |
define('_MPDF_PATH', APPLICATION_PATH.'/../library/MPDF/'); | |
include(_MPDF_PATH.'mpdf.php'); | |
$mpdf = new mPDF('utf-8', 'A4'); | |
$mpdf->SetWatermarkImage('../public/images/logo.png'); | |
$mpdf->showWatermarkImage = true; | |
$mpdf->WriteHTML($HTML); | |
$mpdf->Output("$filename.pdf",'D'); | |
exit(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment