Create Pdf File From Html Or Php In Yii?

I really need help for this problems, I would like to print some receipts so it must be pdf file. The thing is my page have mix of html and php because there are some variables are fetched from the database then render in the table. I’m finding around and find some free library like html2pdf but it requires pure html. I need some helps to solve this issue. Thank in advance.

check this out

I use it with mpdf, this is not super fine, but with small files its enough.

Thank, I will try it :)

Or you can get pure HTML by doing something like


Fot more info read Understanding the view rendering flow