php - Generate PDF file, each object in a new page using Yii framework 2 with mPdf -


using yii framework 2 mpdf tried generate pdf file multiple pages. retrieved data activerecord::find()->all(); means got many model objects back. wanted generate 1 pdf file multiple objects, 1 page 1 object details. below code in action method:

// on top of class signature use mpdf; $mpdf = new mpdf('utf-8', 'a4-l');     $mpdf->setdefaultfont('sjis');     $mpdf->writehtml($html);     $mpdf->output(); 

$html variable contents html tags. how can configure creates new page each object?

you can insert <pagebreak /> tag after each object. insert pagebreak. more information check

http://mpdf1.com/manual/index.php?tid=108


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - Bypass Geo Redirect for specific directories -

php - .htaccess mod_rewrite for dynamic url which has domain names -