Yii Framework Forum: Font Error When Export To Pdf File - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Font Error When Export To Pdf File Rate Topic: -----

#1 User is offline   Nguyen Phuc 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 03-March 14

Posted 03 March 2014 - 07:14 AM

Hi all,
I have a mistake when export data to pdf file,
$student = Students::model()->findByAttributes(array('id'=>$_REQUEST['id']));
$student = $student->first_name.' '.$student->last_name.' Profile.pdf';
$pdf = Yii::app()->ePdf->mpdf('', 'A4', 0, 'Tahoma', 2, 2, 2, 2);

try {
$pdf->AddPage('L');
$pdf->useAdobeCJK = true;
$pdf->cacheTables = false;
// $pdf->layout = 'myview';
//$mylayout = new myview();
$pdf->WriteHTML($this->renderPartial('myprintpdf', array('model'=>$this->loadModel($_REQUEST['id'])),true, false));
$pdf->Output($student, 'D');
} catch (Exception $exc) {
echo $exc->getTraceAsString();
}

when i run this function, the pdf file was create have some char not in utf-8 standard, what should i do now?
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users