- Posts: 59
- Thank you received: 3
Ask the community, share ideas, and connect with other LimeSurvey users!
tammo wrote:
since the PDF output from LimeSurvey is a bit hard to alter, we use MPDF implemented in the backend. This works great, but you have to do some styling yourself.
www.mpdf1.com/mpdf/index.php
<?php $content = get_include_contents('??????'); include('./mpdf/mpdf.php'); $mpdf=new mPDF(); $mpdf->WriteHTML($content); $mpdf->Output(example.pdf,'D'); exit; ?>
Yii::setPathOfAlias('myPlugin', $basedir); Yii::import('myPlugin.third_party.thirdPartyClass'); $newClass = new thirdPartyClass();
myPlugin/myPlugin.php myPlugin/third_party.thirdPartyClass.php
<?php $advice = $_POST["advice"]; include('./mpdf/mpdf.php'); $mpdf=new mPDF(); ob_start(); echo '<div>You should follow our ' . $advice . ' course</div>'; $html = ob_get_contents(); ob_end_clean(); $mpdf->WriteHTML($html); $mpdf->Output(example.pdf,'D'); exit; ?>