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
Comments
Post a Comment