Welcome Guest, Not a member yet? Register   Sign In
DomPDF help!!
#1

[eluser]andregufc[/eluser]
I'm from Portugal, and i can't speack english, my english is not good, but please help me.

I have a form with results of a search, and have one checkbox for each result.

If I select more of 5 results, the pdf not display.

My code:

*************************************************
$this->load->plugin('to_pdf');
$sql='WHERE';
foreach($_POST['opcoes'] as $selecionados){
$sql .= ' Imo_Codigo=\''.$selecionados.'\' OR ';
}
$dados['results'] = $this->db->query('SELECT * FROM Imovel '.$sql.'Imo_Codigo = \'FINALIZA_OR\'');
$html = $this->load->view('cadimobiliario_modoficha', $dados, true);
pdf_create($html, 'Pesquisa Imovel', 'landscape');

*************************************************

if i select 1,2,3,4 or 5 results, the pdf is displayed ok.

Whats the problem? Performance? DomPDF? My Code?

Thx very much!
#2

[eluser]andregufc[/eluser]
help plz!!
#3

[eluser]andregufc[/eluser]
ninguem?
#4

[eluser]John_Betong[/eluser]
Hi andregufc,

I would be tempted to place the following line of code immediately after your for/next loop and to test for 1, 2, 3, etc.
Code:
echo $sql; die;
Then copy & paste the result directly into your http://localhost/PhpMyAdmin/
 
 
 
 
Another useful function to try is:
Code:
$this->db->last_query();
 
 
 
Another way of checking without having to edit your code and see the result is to have the following: (once again copied & posted immediately after your for/next loop)
Code:
$data['debug'] = $sql;
 
AND in your view:
Code:
<head>
  <title><?= isset($debug) ? $debug : 'No SQL available' ?></title>
   ...
</head>
[code]
 
 
#5

[eluser]andregufc[/eluser]
is not sql error. If the html document returned is big, dompdf dont generate de pdf. plz test whit big documents.

plz help! thanks
#6

[eluser]Crimp[/eluser]
Edit your php.ini to increase memory etc...
#7

[eluser]andregufc[/eluser]
im cant modify the php.ini because the server is online. dont have other solution?

thanks
#8

[eluser]John_Betong[/eluser]
[quote author="andregufc" date="1188843671"]im cant modify the php.ini because the server is online. dont have other solution?

thanks[/quote]

Hi AndreGgufc,

Copy & paste this code (from my PHP help) into your your view and play about with it.

Code:
<?php
        /*
        Our php.ini contains the following settings:
        
        display_errors = On
        register_globals = Off
        post_max_size = 8M
        */
        echo 'display_errors = '      .ini_get('display_errors')      ."<br />";
        echo 'register_globals = '    .ini_get('register_globals')    ."<br />";
        echo 'post_max_size = '       .ini_get('post_max_size')       ."<br />";
        echo 'post_max_size+1 = '     .(ini_get('post_max_size')+1)   ."<br />";
        echo 'post_max_size in bytes = ' . return_bytes(ini_get('post_max_size'));
        
        function return_bytes($val) {
            $val = trim($val);
            $last = strtolower($val{strlen($val)-1});
            switch($last) {
                // The 'G' modifier is available since PHP 5.1.0
                case 'g':
                    $val *= 1024;
                case 'm':
                    $val *= 1024;
                case 'k':
                    $val *= 1024;
            }
        
            return $val;
        }
      ?&gt;
&nbsp;
Cheers,
&nbsp;
John_Betong
&nbsp;
&nbsp;
#9

[eluser]andregufc[/eluser]
Result for 1 register:
display_errors = 1
register_globals = 1
post_max_size = 8M
post_max_size+1 = 9
post_max_size in bytes = 8388608

==========

4 register:
display_errors = 1
register_globals = 1
post_max_size = 8M
post_max_size+1 = 9
post_max_size in bytes = 8388608


The genaration of the view is very fast, but the conversion to pdf is not fast, and not complete. If i select more than 4 registers, the conversion stop whitout errors.

The SQL is ok, because the view is displayed, the error is in conversion to pdf in the logns views.

thnks
#10

[eluser]John_Betong[/eluser]
Hi AndreGgufc,

Can you check the manual for ini_set(...).

The function may get round your problem of "im cant modify the php.ini because the server is online."

Cheers,

John_Betong
&nbsp;




Theme © iAndrew 2016 - Forum software by © MyBB