Welcome Guest Search | Active Topics | Sign In | Register

Url to PDF timeout Options
Emir
Posted: Wednesday, March 6, 2013 3:14:21 AM
Rank: Newbie
Groups: Member

Joined: 3/6/2013
Posts: 2
I have an MVC 4 project with Windows Authentication and I am using KendoUI to display charts and grids. As the data in the charts are loaded with Ajax I have to use the manual trigger. This is the code in my controller.
Code: C#
[HttpGet]
        public ActionResult ExportToPdf()
        {
            WindowsIdentity winId = (WindowsIdentity)HttpContext.User.Identity;
            WindowsImpersonationContext ctx = null;
            var ms = new MemoryStream();
                ctx = winId.Impersonate();

                var doc = new EO.Pdf.PdfDocument();
                string url = "http://localhost/WebClient/Dashboard";
                HtmlToPdf.Options.MaxLoadWaitTime = 1000;
                HtmlToPdf.Options.MaxLoadWaitTime = 30000;
                HtmlToPdf.Options.TriggerMode = HtmlToPdfTriggerMode.Manual;
                HtmlToPdf.Options.NoLink = true;
                HtmlToPdf.Options.PreserveHighResImages = false;
                HtmlToPdf.ConvertUrl(url, doc);
                doc.Save(ms);
                ms.Position = 0;
          
                if (ctx != null)
                    ctx.Undo();
          
            return new FileStreamResult(ms, "application/pdf")
            {
                FileDownloadName = "NSSDashboard.pdf"
            };
        }


In the dashboard view I load 6 partial views and in my Layout page I have placed this to trigger the conversion.
Code: JavaScript
jQuery(document).ajaxStop(function () {
        if (typeof (eopdf) == "object") {
            eopdf.convert();
        }
    });


Converting times out 9 times of 10.

But if I remove two out of 6 controls/partial views. No matter which ones then it is fine. None of these partial views include extra javascript files or anything like that. All those things are done from the Layout page.

I am using the latest package from the NuGet. Hit me if you need more info.
Emir
Posted: Wednesday, March 6, 2013 4:29:10 AM
Rank: Newbie
Groups: Member

Joined: 3/6/2013
Posts: 2
I just made it a lot faster by removing this line from the layout page
@Scripts.Render("~/bundles/modernizr")

Then I am using 2.5.3 of modernizr. I put it back again, slow. Remove it. Fast. Tried with chrome and IE same result.
eo_support
Posted: Wednesday, March 6, 2013 8:27:49 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,195
Hi,

We can't think of anything that can cause this. If you can isolate the problem into a test project we will be happy to take a look. Let us know when you have the test project so that we can tell you where to send it.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.