How can I render existing view for output to PDF?

FeliceAGiles

New Member
I am using the TCPDF app in CakePHP as a vendor. I have everything setup according to the instructions. I am able to produce a valid PDF and it works great. Now I want to take the results of an HTML rendered view that already exists and create a PDF from it.I set the HTML variable and use that in the view as:\[code\]$pdf->writeHTML($html, true, false, true, false, '');\[/code\]Here is what I have tried and it renders a blank screen:\[code\]ob_start();$this->render('results', 'pdf');$data = http://stackoverflow.com/questions/3604977/ob_get_contents();ob_end_clean();$this->set('html', $data);\[/code\]I have also tried:\[code\]$data = http://stackoverflow.com/questions/3604977/$this->results();$this->set('html', $data);\[/code\]But it only shows the PDF with the word \[code\]OBJECT\[/code\] in it.How can I render an existing view but have the output directed to the PDF?
 
Back
Top