I’ve been trying to generate a pdf for several days, and the truth is that I do not know what else to do, I’ve already gone through several errors to create a pdf and now my biggest achievement is a blank sheet.
And although I have a view that should be shown, it is not seen.
I leave the code that I use in my controller:
$ model = $ this-> loadModel ($ id);
$ mPDF1 = Yii :: app () -> ePdf-> mpdf (‘utf-8’, ‘A4’, ‘’, ‘’, 15,15,35,25,9,9, ‘P’);
// $ mPDF1-> useOnlyCoreFonts = true;
$ mPDF1-> SetTitle (“Family Credential”);
$ mPDF1-> SetAuthor ("");
// $ mPDF1-> SetDisplayMode (‘fullpage’);
$ mPDF1-> WriteHTML ($ this-> renderPartial (‘pdf’, array (‘model’ => $ this-> loadModel ($ id)), true));
ob_end_clean ();
$ mPDF1-> Output ();
exit;
I hope and can receive your support, I have already received a lot from this community and the truth I thank you.
It looks interesting and good.
But I do not use another package because I’m working for someone, and that someone asked me to use mpdf.
Unless I misunderstood and that package can be used in conjunction with mpdf.