public string executarOcr(string arquivo) { try { string documento = Ocr.castTopdf(arquivo, oGdPictureImaging, oGdPicturePDF); getPastaDestino(documento, arquivo); } catch (Exception ex) { var logpath = ConfigurationManager.AppSettings["PastaDestinoLog"].ToString(); File.AppendAllText(logpath + @"\" + "log.txt", ex.ToString()); // Console.WriteLine(ex.Message); } return(""); }