Trying to export PDF [Blank Page] |
[eluser]Unknown[/eluser]
HI, I'm new to CodeIgniter and I'm just trying to generate a PDF document from a view. I'm using DOMPdf as described in this link but once I run the controller, a blank page appears. It just seems to work when I reduce all the view's HTML to something like "<h1>TEST</h1>"... I guess it is a memory_limit issue, but even upgrading it to 96 or 128MB (even in localhost) it doesn't work. Can anyone help me? This is my code: CONTROLLER: Code: <?php VIEW: Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
[eluser]pegas[/eluser]
Structure the source code as a helper and not a plugin and it will work. Just rename the to_pdf_pi.php file to to_pdf_helper.php and move the sources, and that's it ![]()
[eluser]Amitabh Roy[/eluser]
Generating pdf with dompdf has its own set of woes. If you are getting blank pages , you may need to comment the extension=php_pdf.dll in php.ini and restart apache and then again try to generate the pdf. Check this post on bambooinvoice forum , on which I posted a solution around 3 years ago. Bamboo invoice forum - pdf generation fails using dompdf
[eluser]CroNiX[/eluser]
In order to get the view as a variable you need to set the 3rd parameter to TRUE. $html = $this->load->view('table',$data, TRUE); Otherwise it outputs directly to the browser. http://ellislab.com/codeigniter/user-gui...oader.html |
Welcome Guest, Not a member yet? Register Sign In |