![]() |
Getting error with DOMPDF on Codeigniter 2 + dompdf-0.5.2 - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Getting error with DOMPDF on Codeigniter 2 + dompdf-0.5.2 (/showthread.php?tid=40455) |
Getting error with DOMPDF on Codeigniter 2 + dompdf-0.5.2 - El Forum - 04-09-2011 [eluser]Unknown[/eluser] Hello dear friends. I am new here, this is my first post! I am trying to use the DOMPDF to generate PDF files, but i am getting an error. My script works like that: We get the data from the database, use a parser to parse the view model and output it to the PDF (as everyone do). My code: Code: $dados = array( Of course the variables from $dados have been declared before The error i receive is: Fatal error: Uncaught exception 'PDFlibException' with message 'Cannot modify header information - headers already sent by (output started at C:\xampplite\htdocs\codeigniter\system\helpers\to_pdf_helper.php:18)' in C:\xampplite\htdocs\codeigniter\system\helpers\dompdf\include\pdflib_adapter.cls.php:833 Stack trace: #0 C:\xampplite\htdocs\codeigniter\system\helpers\dompdf\include\pdflib_adapter.cls.php(833): header('Cache-Control: ...') #1 C:\xampplite\htdocs\codeigniter\system\helpers\dompdf\include\dompdf.cls.php(447): PDFLib_Adapter->stream('filename.pdf', NULL) #2 C:\xampplite\htdocs\codeigniter\system\helpers\to_pdf_helper.php(11): DOMPDF->stream('filename.pdf') #3 C:\xampplite\htdocs\codeigniter\application\controllers\relacoes.php(80): pdf_create('Cad MUNI SAMBA ...', 'filename') #4 [internal function]: Relacoes->processar('1') #5 C:\xampplite\htdocs\codeigniter\system\core\CodeIgniter.php(325): call_user_func_array(Array, Array) #6 C:\xampplite\htdocs\codeigniter\index.php(198): require_once('C:\xampplite\ht...') # in C:\xampplite\htdocs\codeigniter\system\helpers\dompdf\include\pdflib_adapter.cls.php on line 833 ORIGINAL MESSAGE: Quote:Fatal error: Uncaught exception 'PDFlibException' with message 'Cannot modify header information - headers already sent by (output started at C:\xampplite\htdocs\codeigniter\system\helpers\to_pdf_helper.php:18)' in C:\xampplite\htdocs\codeigniter\system\helpers\dompdf\include\pdflib_adapter.cls.php:833 Stack trace: #0 C:\xampplite\htdocs\codeigniter\system\helpers\dompdf\include\pdflib_adapter.cls.php(833): header('Cache-Control: ...') #1 C:\xampplite\htdocs\codeigniter\system\helpers\dompdf\include\dompdf.cls.php(447): PDFLib_Adapter->stream('filename.pdf', NULL) #2 C:\xampplite\htdocs\codeigniter\system\helpers\to_pdf_helper.php(11): DOMPDF->stream('filename.pdf') #3 C:\xampplite\htdocs\codeigniter\application\controllers\relacoes.php(80): pdf_create('Cad MUNI SAMBA ...', 'filename') #4 [internal function]: Relacoes->processar('1') #5 C:\xampplite\htdocs\codeigniter\system\core\CodeIgniter.php(325): call_user_func_array(Array, Array) #6 C:\xampplite\htdocs\codeigniter\index.php(198): require_once('C:\xampplite\ht...') # in C:\xampplite\htdocs\codeigniter\system\helpers\dompdf\include\pdflib_adapter.cls.php on line 833 Has anyone experienced this kind of problem, and can anyone help with this, tell me what is hapening? Obs: I am using a local XAMPP server on Windows 7 Thank you very much. Getting error with DOMPDF on Codeigniter 2 + dompdf-0.5.2 - El Forum - 04-19-2012 [eluser]Riley123[/eluser] I get an error too: Warning: require_once(/Applications/MAMP/htdocs/extranet/application/helpers/dompdf/include/ci_exceptions.cls.php) [function.require-once]: failed to open stream: No such file or directory in /Applications/MAMP/htdocs/extranet/application/helpers/dompdf/dompdf_config.inc.php on line 208 Fatal error: require_once() [function.require]: Failed opening required '/Applications/MAMP/htdocs/extranet/application/helpers/dompdf/include/ci_exceptions.cls.php' (include_path='.:/Applications/MAMP/bin/php/php5.3.6/lib/php') in /Applications/MAMP/htdocs/extranet/application/helpers/dompdf/dompdf_config.inc.php on line 208 No idea why. dompdf doesn't even have a file called ci_exceptions.cls.php Getting error with DOMPDF on Codeigniter 2 + dompdf-0.5.2 - El Forum - 04-19-2012 [eluser]Ayeyermaw[/eluser] @Muni It appears that your helper "to_pdf_helper.php" has already output a header (possibly an error) prior to calling the dompdf output. That's where you need to start looking. Also as a side note. Do you really want to be putting custom helpers in the codeigniter system folder? You could have problems when you update future versions of codeigniter Getting error with DOMPDF on Codeigniter 2 + dompdf-0.5.2 - El Forum - 09-24-2012 [eluser]Unknown[/eluser] @Riley123 Warning: require_once(/Applications/MAMP/htdocs/extranet/application/helpers/dompdf/include/ci_exceptions.cls.php) [function.require-once]: failed to open stream: No such file or directory in /Applications/MAMP/htdocs/extranet/application/helpers/dompdf/dompdf_config.inc.php on line 208 Fatal error: require_once() [function.require]: Failed opening required ‘/Applications/MAMP/htdocs/extranet/application/helpers/dompdf/include/ci_exceptions.cls.php’ (include_path=’.:/Applications/MAMP/bin/php/php5.3.6/lib/php’) in /Applications/MAMP/htdocs/extranet/application/helpers/dompdf/dompdf_config.inc.php on line 208 I have solved this problem by creating ci_exceptions.cls.php,an empty php file in that directory and i am not getting errors anymore.I dont know whether it is right way bt it is working well and not showing errors now Getting error with DOMPDF on Codeigniter 2 + dompdf-0.5.2 - El Forum - 09-24-2012 [eluser]Shiju S S[/eluser] Quote:Remove ?> from the end of files Getting error with DOMPDF on Codeigniter 2 + dompdf-0.5.2 - El Forum - 09-24-2012 [eluser]Shiju S S[/eluser] Code: $this->load->helper(array('dompdf', 'file')); Quote:?> at the end of controller files will be causing the modify header error. |