Welcome Guest, Not a member yet? Register   Sign In
Getting error with DOMPDF on Codeigniter 2 + dompdf-0.5.2
#1

[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(
       'nome' => $nome,
       'nome_guerra' => $nome_guerra
       );

    $this->load->helper('to_pdf');
    $html = $this->parser->parse('relacoes/modelos/teste', $dados, TRUE);
    pdf_create($html, 'filename');

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.


Messages In This Thread
Getting error with DOMPDF on Codeigniter 2 + dompdf-0.5.2 - by El Forum - 04-09-2011, 01:05 AM



Theme © iAndrew 2016 - Forum software by © MyBB