public object Load(Dictionary<string, string> jsonResult)
{
PdfViewerHelper helper = new PdfViewerHelper();
//load the multiple document from client side
if (jsonResult.ContainsKey("newFileName"))
{
PdfViewerHelper.CachePath = HttpContext.Current.Server.MapPath("~/Data");//Store the cache data in the data folder of the sample.
var name = jsonResult["newFileName"];
var pdfName = name.ToString();
helper.Load(HttpContext.Current.Server.MapPath("~/Data/" + pdfName));
}
else
{
if (jsonResult.ContainsKey("isInitialLoading"))
{
PdfViewerHelper.CachePath = HttpContext.Current.Server.MapPath("~/Data");");//store the cache data in the data folder.
helper.Load((HttpContext.Current.Server.MapPath("~/Data/HTTP Succinctly.pdf")));
}
}
string output = JsonConvert.SerializeObject(helper.ProcessPdf(jsonResult));
return output;
} |
string[] files = Directory.GetFiles(System.IO.Path.GetTempPath());
foreach (string tempFile in files)
{
FileInfo fileInfo = new FileInfo(tempFile);
if (fileInfo.Extension == ".txt" && fileInfo.Name.Contains("Syncfusion_PDFviewer_"))
{
fileInfo.Delete();
}
} |