3

I'm using Rotativa (v1.6.4) for converting an MVC view into a PDF. I have used jQuery in the View to show/hide certain text content.

When I render the View, I see that jQuery is working, but when I render viewaspdf, the jquery is not working.

I have added --debug-javascript --no-stop-slow-scripts --javascript-delay 10000 but this looks to be not working. Can someone help me here?

Here is Controller detail:

    public ActionResult PrintBenificiaryForm()
    {
        PrintBenificiary p = new PrintBenificiary();
        p.TeamMemberInfo = GetSessionValues();
        p.IndividualBenefitPlans = GetBenefitPlansandIndividuals();

        string customSwitches = string.Format("--debug-javascript --no-stop-slow-scripts --javascript-delay 10000 --footer-left \"[page] of [toPage]\" --footer-spacing -10 --footer-font-size \"10\"  --header-html  \"{0}\" ", Url.Action("PrintHeader", "Home", null, this.Request.Url.Scheme));
        return new ViewAsPdf("PrintBenificiaryForm", p)// { FileName = p.TeamMemberInfo.FirstName + " " + p.TeamMemberInfo.LastName + ".pdf" };
        {
            CustomSwitches = customSwitches
        };
        //return View(p);
    }
RickL
  • 3,318
  • 10
  • 38
  • 39
popat
  • 69
  • 1
  • 7

1 Answers1

2

I faced the same issue. I resolved this by editing 'qt.browser' in the 'App_Browsers' folder. It was created by Rotativa during the installing package from NuGet. I changed capability with name="javascriptversion" from 1.7 to my version of jquery - 3.1.1. And this resolved my issue. Hope this help someone

Roma Stets
  • 21
  • 2