public ActionResult ViewDocument(string path, int quality, int width) { string fileNameExtension = Path.GetExtension(path).TrimStart('.'); fileNameExtension = fileNameExtension.ToLower(); string appDataPath = Server.MapPath(AppDataVirtualPath); DocumentDescription documentDescription = SignatureHandler.GetPageDescriptions(Path.Combine(appDataPath, path)); int pageCount = documentDescription.Pages.Count; string[] pageImageUrls = GetImageUrls(path, 0, pageCount, width, quality); UrlHelper urlHelper = new UrlHelper(Request.RequestContext); string documentDownloadUrl = urlHelper.Action("GetDocument", "Signature", new { path }); JavaScriptSerializer serializer = new JavaScriptSerializer(); string documentDescriptionJs = LowerCaseJsonSerializer.SerializeObject(documentDescription); var result = new { path, docType = "Pdf", fileType = fileNameExtension, url = documentDownloadUrl, pdfDownloadUrl = (string)null, name = path, imageUrls = pageImageUrls, lic = true, pdfPrintUrl = (string)null, pageHtml = (object)null, pageCss = (object)null, documentDescription = documentDescriptionJs, urlForResourcesInHtml = (object)null, sharedCss = (object)null, success = true }; return(Json(result)); }