Rotativa.Demo.Controllers.HomeController.TestUrl C# (CSharp) Method

TestUrl() public method

public TestUrl ( ) : ActionResult
return ActionResult
        public ActionResult TestUrl()
        {
            // Now I realize that this isn't very expressive example of why this can be useful.
            // However imagine that you have your own UrlHelper extensions like UrlHelper.User(...)
            // where you create correct URL according to passed conditions, prepare some complex model, etc.

            var urlHelper = new UrlHelper(Request.RequestContext);
            string url = urlHelper.Action("Index", new { name = "Giorgio II." });

            return new UrlAsPdf(url) { FileName = "TestUrl.pdf" };
        }