Use html2pdf from $this->renderpartial in Yii

1.5k views Asked by At

Can I do something like this:

$content = $this->renderpartial('DeedCertificate',array('deed'=>$deed,'cnt'=>$cnt));        
$html2pdf = new HTML2PDF('P','A4','en');
$html2pdf->WriteHTML($content);
$html2pdf->Output('/var/www/myapp/images/example.pdf','F');

$html2pdf->Output when using $content = "hello"l works like a charm. Now I'm trying to pass the output of yii's renderpartial .. so it can become a pdf.. but my pdf is blank.

1

There are 1 answers

2
Developerium On BEST ANSWER

you can make renderPartial to return the html generated for you ,like this:

 $this->renderPartial('DeedCertificate' , array('data'=>$data) , true); // set this to true