Menu

Display GIF/Animation while pdf is being generated

Help
Roger
2014-07-10
2014-08-05
  • Roger

    Roger - 2014-07-10

    Hi Everyone

    I recently created an php app that generates a big pdf file, this file uses information of a mysql database and creates many tables in the pdf document. In some cases, the document takes almost 3 minutes to be generated. I wish to know if there is a way to display an 'loading' image or animation, or a progress bar (I know it's more complicated to determine the progress) while the document is created.

    I use POST method in a form and a submit button with target:_blank, sending 4 parameters that use in the pdf generator file's query.

    Isn't very important to know the progress of the creation, I just want users don't think that the script doesn't work or they close the window.

    Can anyone help please?

     
  • Simon

    Simon - 2014-07-11

    I'd save the PDF to file and then do an AJAX check in the browser to see if the file exists yet.

     
    • Roger

      Roger - 2014-07-11

      I'm new in AJAX... could you share the code or explain how to do it please?

       
  • wsuTech

    wsuTech - 2014-08-05

    I am trying to do the same thing but I am not sure how to approach this without saving the file to the server. I am producing a multi-page PDF that I want to display the "I" option of the Output for TCPDF:

    $pdf->Output('Schedule.pdf', 'I');
    

    And I just want to have some indicator to let the user know the page is working and hasn't frozen.

     

Log in to post a comment.