Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8002471
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T16:22:38+00:00 2026-06-04T16:22:38+00:00

on some pages I give a link that call a page (createPDF.php) which create

  • 0

on some pages I give a link that call a page (createPDF.php) which create a PDF with wkhtmloptf, and the download box can take up to 30 seconds to appear.

I’d like to show a dialog (using jQuery UI) that will show a message while loading the page, then disappear when the download box appear.

Right now:

  1. User click on the PDF icon, it opens a jQuery UI Dialog in which
    user selects Page Orientation and Page Format.
  2. User clicks on ” Generate PDF “, which do:

    ( this ).dialog( "close" );  // Close current dialog (Select page orientation, ...)
    $( "#dialog-modal" ).dialog( "open" );  // Open new dialog (Please wait while ....)
    window.location.href = "<?php echo URL; ?>createPDF.php"; (generate and load the PDF)
    // dialog should close here once the above URL is loaded
    

The dialog showing ” Please wait ” appears but doesn’t disappear when the download box pop up.

Any idea? Thanks in advance!

Edit :

I tried to load the file by Ajax, with the following code:

$.ajax({
    url: "<?php echo URL; ?>createPDF.php",
    async: false, 
    beforeSend: function( xhr ) {
        xhr.overrideMimeType( 'application/octet-stream' );
    },
    success: function(content) {
        $( "#dialog-modal" ).dialog( "close" );
    }
});

The dialog close once the PDF is generated, but I get no download box…

Edit 3:

Finally I used blockUI with a timeout to close it. User can also close the message box if he wants.

$( this ).dialog( "close" );
$.blockUI({ message: '<div style="padding: 20px;"><div style="font-size: 20px;">Veuillez patienter pendant que votre PDF est généré.</div> <br /> Ceci peut prendre quelques secondes. <br /> <br />  Ce message peut disparaître avant que le téléchargement ne commence.</div>' });     
$('.blockOverlay').attr('title','Cliquez pour fermer ce message').click($.unblockUI);
var pdfFormat = $('#pdfFormat').val();
var pdfOrientation = $('#pdfOrientation').val();
pdfURL = pdfURL + "&f=" + pdfFormat  + "&o=" + pdfOrientation;
window.location.href = pdfURL; 
setTimeout(
    function(){
        $.unblockUI();
    }, 5000);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T16:22:39+00:00Added an answer on June 4, 2026 at 4:22 pm

    Finally I used blockUI with a timeout to close it. User can also close the message box if he wants.

    $( this ).dialog( "close" );
    $.blockUI({ message: '<div style="padding: 20px;"><div style="font-size: 20px;">Veuillez patienter pendant que votre PDF est généré.</div> <br /> Ceci peut prendre quelques secondes. <br /> <br />  Ce message peut disparaître avant que le téléchargement ne commence.</div>' });     
    $('.blockOverlay').attr('title','Cliquez pour fermer ce message').click($.unblockUI);
    var pdfFormat = $('#pdfFormat').val();
    var pdfOrientation = $('#pdfOrientation').val();
    pdfURL = pdfURL + "&f=" + pdfFormat  + "&o=" + pdfOrientation;
    window.location.href = pdfURL; 
    setTimeout(
        function(){
            $.unblockUI();
        }, 5000);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i'm switching some pages over to HTML5 which contains headlines that need to be
Can you link me some javascript libraries, that can give me full support html5
I am using Selenium to give rating to some video. The page source for
Some pages are showing the phpinfo() output (in HTML so not php -i )
some pages that use macros like: topusers or popularlabels are really slow to load.
I have some pages that I don't want users to be able to access
I have some pages on my public website that display charts generated by ASP.NET
I have some pages that reference javascript files. The application exists locally in a
My Rails app has some pages which are SSL-required and others which are SSL-optional.
Lets suppose that I have some pages some.web/articles/details/5 some.web/users/info/bob some.web/foo/bar/7 that can call a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.