Rank: Newbie Groups: Member
Joined: 6/18/2019 Posts: 4
|
Hi, I'm using trial version 2019 . Thank you so much for your great support.
I'm facing one issue , after MVC view is rendered successfully, I have to return to different view , I tried with several approaches such as RedirectToAction , return View("Index") , etc...but its not redirecting. I'm clueless how to resolve it.
Could you please kindly help to resolve it.
This is the only issue I'm having , otherwise, I'm perfectly fine with EO libraries.
The code is like this,
[EO.Pdf.Mvc.RenderAsPDF(AutoConvert = false)] public ActionResult CreatePDF() { HtmlToPdf.Options.BeforeRenderPage += this.On_BeforeRenderPage;
MVCToPDF.SendToClient = true; MVCToPDF.ResultAsDownload = false; MVCToPDF.ResultFileName = "TestFile.PDF"; MVCToPDF.RenderAsPDF(AfterRender);
return View("Index"); //ReDirectToAction("Index","Home"); //Index(); }
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,258
|
Hi,
You will need to apply the RenderAsPDF attribute on the last action in this case. In your case, you should apply the attribute and call RenderAsPDF inside your Index action. You may want to set/pass some flag to the Index action from your CreatePDF action and then check for this flag in your Index action. The rule is it applies to the last leg since the HTML to PDF converter needs to intercept the final output.
Thanks!
|
Rank: Newbie Groups: Member
Joined: 6/18/2019 Posts: 4
|
Thanks for the reply , I try with your approach.
|