public function actionGeneratePdf() { $this->layout = 'pdf'; $model = new Stockname('search'); if (isset($_GET['Stockname'])) { $model->attributes = $_GET['Stockname']; } // to execute the filters (if is the case) $dataProvider = $model->search(); $dataProvider->pagination = false; $mPDF1 = Yii::app()->ePdf->mpdf(); # You can easily override default constructor's params $mPDF1 = Yii::app()->ePdf->mpdf('', 'A5'); # renderPartial (only 'view' of current controller) $mPDF1->WriteHTML($this->renderPartial('admin', array('model' => $model), true)); # Outputs ready PDF $mPDF1->Output(); }