Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make Rotativa wait for javascript/jquery execution

Tags:

rotativa

I have a View that renders and some javascript/jquery that updates some fields. When I use Rotativa, it renders the view, but before the JS is executed to replace some field text.

Is there a way to delay Rotativa or have it wait for JS/JQuery?

like image 605
Loren.Dorez Avatar asked Jul 23 '14 19:07

Loren.Dorez


2 Answers

You should be able to delay pdf creation to wait for javascript to complete by setting this in Rotativa params:

CustomSwitches = "--no-stop-slow-scripts --javascript-delay 1000 "

Replace 1000 with the desired milliseconds.

like image 176
Giorgio Bozio Avatar answered Oct 18 '22 15:10

Giorgio Bozio


I was facing same issue, and after so much googling and experiment my problem resolved by updating Rotativa to latest stable version as 1.6.4 using Manage Nuget Packages. May be it will help someone. Thanks.

like image 44
RP Nainwal Avatar answered Oct 18 '22 15:10

RP Nainwal