code: public function actionExportPdf()
      {
          $searchModel = new MahasiswaSearch();
          $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
          $html = $this->renderPartial('_pdf',['dataProvider'=>$dataProvider]);
          $mpdf=new \mPDF('c','A4','','' , 0 , 0 , 0 , 0 , 0 , 0);  
          $mpdf->SetDisplayMode('fullpage');
          $mpdf->list_indent_first_level = 0;  // 1 or 0 - whether to indent the first level of a list
          $mpdf->WriteHTML($html);
          $mpdf->Output();
          exit;
      }
docs: /*
  EXPORT WITH MPDF