1

Hello

I have problems creating a PDF where there is some tables that can haves thousands of rows. When I try to create the PDF, HTML2PDF start to take a lot of memory (I set the memory limit at 512M ... it has to be sufficient for any script). For 'smalls PDFs' (like 10 pages ones) it takes a long time of processing. One with 2 pages takes more than 26 seconds.

Is it normal? Is there any way to reduce the memory or the processing time?

Thank you

2

try to simplify your html : does not use divs if unnecessary, or nobreak tag.

have you try the debug mode, to see the performances ?

can you post here you html ? (but with only 2 rows)
Ancien pseudo : lolo

3

There is no divs in my html and yes, I've tried the debug mode. Here are the results:

step time delta memory peak

Init debug 0.0 ms 0.0 ms 9 164.6 Ko 11 493.9 Ko

PAGE n°1 Begin 977.2 ms 977.2 ms 18 656.8 Ko 23 824.6 Ko

Table n°1 Begin 996.6 ms 19.4 ms 18 756.0 Ko 23 824.6 Ko

Table n°1 End 1 026.5 ms 29.9 ms 18 848.1 Ko 23 824.6 Ko

Table n°2 Begin 1 033.6 ms 7.1 ms 18 857.9 Ko 23 824.6 Ko

Table n°2 End 1 053.2 ms 19.7 ms 18 886.1 Ko 23 824.6 Ko

Table n°3 Begin 1 055.1 ms 1.8 ms 18 893.9 Ko 23 824.6 Ko

Table n°3 End 1 082.1 ms 27.0 ms 18 909.2 Ko 23 824.6 Ko

Table n°4 Begin 1 082.6 ms 0.5 ms 18 917.0 Ko 23 824.6 Ko

Table n°4 End 1 335.9 ms 253.3 ms 18 971.1 Ko 23 824.6 Ko

Table n°5 Begin 1 336.4 ms 0.5 ms 18 978.9 Ko 23 824.6 Ko

Table n°5 End 27 517.7 ms 26 181.3 ms 24 221.6 Ko 24 475.5 Ko

Table n°6 Begin 27 518.3 ms 0.6 ms 24 229.4 Ko 24 475.5 Ko

Table n°6 End 27 547.4 ms 29.2 ms 24 245.9 Ko 24 475.5 Ko

Table n°7 Begin 27 548.0 ms 0.6 ms 24 253.7 Ko 24 475.5 Ko

Table n°7 End 27 623.4 ms 75.3 ms 24 263.1 Ko 24 492.4 Ko

PAGE n°9 End 27 623.7 ms 0.3 ms 24 263.0 Ko 24 492.4 Ko

Before output 27 648.4 ms 24.8 ms 19 654.5 Ko 24 492.4 Ko

A sample of the rows would be:
<tr>
<td>958133299</td>
<td>InterProvinciales</td>
<td>Granada</td>
<td>2011-01-27</td>
<td>21:57:37</td>
<td>1m 20s</td>
<td align="right">0.0519 €</td>
</tr>
<tr>
<td>915172103</td>
<td>Metropolitanas</td>
<td>Madrid</td>
<td>2011-01-27</td>
<td>21:57:38</td>
<td>14s</td>
<td align="right">0.0084 €</td>
</tr>

4

i suppose that you big table is the 5 ?

do you use some specific parameters in your table ? or a specific CSS ?

do you just use this ?
<page>
    <table>
    <tr>
        <td>958133299</td>
        <td>InterProvinciales</td>
        <td>Granada</td>
        <td>2011-01-27</td>
        <td>21:57:37</td>
        <td>1m 20s</td>
        <td align="right">0.0519 €</td>
    </tr>
    <tr>
        <td>915172103</td>
        <td>Metropolitanas</td>
        <td>Madrid</td>
        <td>2011-01-27</td>
        <td>21:57:38</td>
        <td>14s</td>
        <td align="right">0.0084 €</td>
        </tr> 
    </table>
</page>
Ancien pseudo : lolo

5

i have try width 600 lines, and it take lots of times... 29seconds for 12 pages sad

but you have more than 4200 TD, and for each TD, HTML2PDF precalculate the size. it is why it takes lot of times sad

but for make the PDF that you whant, are you sure that you need HTML2PDF ? it is just a real basic table, and TCPDF can make it very faster.

Ancien pseudo : lolo

6

Thank you Spipu, I will try with TCPDF. I hope it works fine with this PDF.

Edit: It worked! I have made a 1874 pages PDF with a laaaaaarge table. It just took 3.5 minutes! (the time to get the data and create the structure).

Thank you very much!!!