Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Sep 2006
    Location
    India Mumbai
    Posts
    248
    Thanks
    13
    Thanked 1 Time in 1 Post

    Memory size problem and DOMPDF

    hi all,
    I am using DOMPDF to generate certain reports. Its working fine. Below is the layout of my PDF
    <html>
    <body>
    <Headers>
    <Products>
    <Production Units>
    <Processing Units>
    <footer>
    </body>
    </html>

    this works fine. But there is a case come up where there is huge huge data. The Pdf goes up to 10 pages. The script gets execution time out problem when i try to render() the output in DOMPDF. if i print the buffer output just in PHP it works but with PDF its an issue.
    I breaked the buffer output in chunks and take the output in different variables.
    $html_3=ob_get_contents(); // $html_4 , 5 , 6 and so on
    ob_end_clean(); // delete Output-Buffer
    ob_start();


    $html_L=ob_get_contents(); // last content of the page
    // delete Output-Buffer
    ob_end_clean();
    $html=$html_1.$html_2.$html_3;
    //$html.=$html_L;
    //print $html;

    but still i am having the same issue.

    This is what i do for managing buffer and script time out for that page:

    ini_set("memory_limit","850M");
    set_time_limit('120');

    So a conclusion lands up is the memory size of the variable. if i just print upto html_1 and html_2 its fine. but if i try to concate further its a problem.

    So how can i handle this issue. Please Please help.


    Thanks in anticipation

  • #2
    Regular Coder
    Join Date
    Sep 2006
    Location
    India Mumbai
    Posts
    248
    Thanks
    13
    Thanked 1 Time in 1 Post
    I have proceeded further up to concatenating all the variables and rendering the output. but now i got the real problem. there is a stored procedure which has one column and it has large chunk of data. To print PRoduction Units i run that stroed procedure data in a foreach() loop. if i remove that element from the print, PDF gets generated. but if i include it then the whole things is screwed up.

    Html renders fine but PDF cant handle that column. How can i do it

  • #3
    Regular Coder
    Join Date
    Sep 2006
    Location
    India Mumbai
    Posts
    248
    Thanks
    13
    Thanked 1 Time in 1 Post
    i am getting execution time out error. i changed the settings in all possible cases (both in php.ini and the page itself) but no use. if the execution time is increased, the <script> goes into execution with no output rendered.

    below is what i changed in php.ini


    max_execution_time = 300 ; Maximum execution time of each script, in seconds
    max_input_time = 1000; Maximum amount of time each script may spend parsing request data
    memory_limit = 850M ; Maximum amount of memory a script may consume (8MB)

    and also alternatively in the page code itself to:

    ini_set("memory_limit","850M");

    set_time_limit('1000');

    but no success and again the same error message of execution time out. my main concern is if i print just the $html in simple PHP without DOMPDF, it work fine. that means no problem with my code. It means DOMPDF is not able to handle this

    Please help if anyone has some solution on it
    Thanks


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •