1

hi all,

i'm tring to generate pdf file from html tags. problem with that my html content is much large , when it generating it over flow the buffer.
(my html content has 10 pages, i can only generate upto 7th page only. when it goes to 10th it gives this error)
I have no permission to increase the memory size on php.ini also the execution time.

Is there any method/way to read this html content part by part & finally generating one pdf??

thanks in advance

regards,
Ramadha

2

you can use writeHTML for each part of you document separately
Ancien pseudo : lolo

3

thanks for the reply
i have written the code like this,

<?php ob_start(); ?>
html content 1
<?php $content1 = ob_get_clean(); ?>

<?php ob_start(); ?>
html content 2
<?php $content1 = ob_get_clean(); ?>
...........
$html2pdf->WriteHTML($content1.$content2, isset($_GET['vuehtml']));
$html2pdf->Output('form00.pdf');

But it didn't work, gives same memory error

please help me to fix this

ramadha

4

try this :

<?php
$html2pdf = new HTML2PDF(...);
ob_start();
?>
html content 1
<?php
$content = ob_get_clean();
$html2pdf->WriteHTML($content);
ob_start();
?>
html content 2
<?php
$content = ob_get_clean();
?>
$html2pdf->WriteHTML($content);
$html2pdf->Output('form00.pdf'); 
Ancien pseudo : lolo

5


sorry , it gives the same error !
hope still buffer is filling at once

ramadha

6

do you use the last version of HTML2PDF, with the optimize html parseur ?
Ancien pseudo : lolo

7

i'm using html2pdf_v3.18

what is the latest version?

ramadha

8

3.19 wink
Ancien pseudo : lolo

9

sorry , still same error !

from 3.18 i hv generated upto 7th page(gives error whn goes to 10th)
but from 3.19 it only allow upto 6th, it has reduced one page confus

10

?!

what are your values of memory_limit and limit_execution_time ?
Ancien pseudo : lolo

11

16MB & 30 sec (default values on php.ini, i'm on shared hosting, so no permissions to change those)

12

and with 16Mb on memory, you can't generate a pdf of 10 pages ?! what is the size of $content ? (echo strlen($content); exitwink
Ancien pseudo : lolo

13

for :echo strlen($content) >>print the output as : 154479

(my actual file size is 153kb)

14

how, it a big html sad

could you post it here by using the link "Joindre un fichier ou une image " ?
Ancien pseudo : lolo

15

it just a contact form , it's full with conditions...etc.
there's a original form(with pdf format), so i had converted it to html . then i'm trying to fill it & regenerate the pdf again.
hope that html content is much large because of it's full with div positions tags( i hv to get original form format, so no choice for that)

sorry i have no permission to view the html contents

16

Hi Ramadha,
Add this statement to your .htaccess file in your web root "php_value memory_limit 64M" and check the php.ini in the memory_limit you should Find 64M instead of 16M, If you find 64M it may solve your problem.


Viswanath1