public object Load(Dictionary<string, string> jsonResult)
{
PdfViewerHelper helper = new PdfViewerHelper();
//load the multiple document from client side
if (jsonResult.ContainsKey("newFileName"))
{
var name = jsonResult["newFileName"];
var pdfName = name.ToString();
string path = HttpContext.Current.Server.MapPath("~/content/images/FileExplorer/" + pdfName);
helper.Load(path);
}
else
{
if (jsonResult.ContainsKey("isInitialLoading"))
{
if (jsonResult.ContainsKey("file"))
{
string path = HttpContext.Current.Server.MapPath("~/" + jsonResult["file"].ToString().Substring(jsonResult["file"].ToString().IndexOf("/") + 1));
helper.Load(path);
}
else
{
string path = HttpContext.Current.Server.MapPath("~/content/images/FileExplorer/pdf/HTTP Succinctly.pdf");
helper.Load(path);
}
}
}
string output = JsonConvert.SerializeObject(helper.ProcessPdf(jsonResult));
return output;
}
|