3
votes

I'm using prawn and prawnto for PDF-generation in my rails-app. Is there a way to show the user a spinner or progress bar while the PDF is generated?? I think about showing a spinner-div in the document with the "generate-pdf-link" when starting the pdf-action and then removing it when the rendering finished (everything e.g. with jquery). How can I trigger that??

Thanks for your help!

1
Did you able to setup progress bar ? How ?krunal shah

1 Answers

0
votes

Instead of generating the PDF immediately, you could display a result page with a spinner, and generate the pdf in a background job. I recommend the Gems DelayedJob or Resque for creating background jobs, placing them on multiple queues, and processing them later. There are good Railscasts for both. You can use a jQuery Timer plugin to check periodically if the PDF has been generated.