public async Task <IActionResult> Add(List <IFormFile> files) { List <string> list = new List <string>(); long size = files.Sum(f => f.Length); // full path to file in temp foreach (var formFile in files) { if (formFile.Length > 0) { var filePath = Path.GetTempPath() + formFile.FileName; using (var stream = new FileStream(filePath, FileMode.Create)) { await formFile.CopyToAsync(stream); } list.Add(filePath); } } await ProcessPDF.AddPDFs(list); return(View("Index").WithSuccess("Sucess: ", "All PDFs was saved")); //return View("Index"); }
static void Main(string[] args) { string path = @"{path of document}"; ProcessPDF.AddPDFs(new List <string>() { path }); var result = ProcessPDF.GetVisualResults("{your search word}"); string json = JsonConvert.SerializeObject(result); string jsonFormatted = JValue.Parse(json).ToString(Formatting.Indented); Console.WriteLine(jsonFormatted); Console.ReadKey(); }