Skip to content Skip to sidebar Skip to footer

Progress Bar While Opening Pdf Using Fpdf

I am generating a lot of pdf reports using fpdf class. While opening pdf a 'loading....' image (using cookies along with an animated .gif) is working on the page and it disappears

Solution 1:

yes it's possible. the question then is how you'd get the server to notify the client on what percentage it's on. that's a bit more complex. web-sockets would be optimal but the most difficult to implement.. an easier way would be to get the client to poll the server (say every 1s) during the pdf generation to ask it what percentage it's on.

here's the client code though to get you started.

// using jquery 
$('#bar').animate({width: '35%'});
#barContainer {
  width:300px;
  height:15px;
  border:1px solid #ccc;
}

#bar {
  height:100%;
  width:0%;
  background:#0198E1;
}
<scriptsrc="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script><divid='barContainer'><divid='bar'></div></div>

Post a Comment for "Progress Bar While Opening Pdf Using Fpdf"