public string SendForEsign() { BuildDocuSignFields docusign = new BuildDocuSignFields(); List <DocumentField.SendDocumentInfo> Docs = new List <DocumentField.SendDocumentInfo>(); DocuEsign esn = new DocuEsign(); #region build Doc one string filepath1 = ConfigurationManager.AppSettings["Docu1FilePath"]; string base64worddoc = Convert.ToBase64String(File.ReadAllBytes(filepath1)); var obj = docusign.BuildDocFields(); obj.FileBase64String = new WordReader().FillValuesToDoc(Convert.FromBase64String(base64worddoc), "", obj); Docs.Add(obj); #endregion #region build Doc two string filepath2 = ConfigurationManager.AppSettings["Docu2FilePath"]; string base64worddoc1 = Convert.ToBase64String(File.ReadAllBytes(filepath2)); var obj1 = docusign.BuildDocFields(); obj1.FileBase64String = new WordReader().FillValuesToDoc(Convert.FromBase64String(base64worddoc1), "", obj1); Docs.Add(obj1); #endregion string docuID = esn.SendForESign(Docs); return(docuID); }
public string fillDocument() { string Path = ConfigurationManager.AppSettings["Docu1FilePath"]; string base64WordDoc = Convert.ToBase64String(File.ReadAllBytes(Path)); BuildDocuSignFields docu = new BuildDocuSignFields(); var obj = docu.BuildDocFields(); obj.FileBase64String = new WordReader().FillValuesToDoc(Convert.FromBase64String(base64WordDoc), "", obj); File.WriteAllBytes(@"D:\Visual Studio 2015\Projects\WindowsServiceLender\WindowsServiceLender\TestFilledDocs\TestFillDoc.docx", Convert.FromBase64String(obj.FileBase64String)); return("DOCUMENT FILL SUCCESSFUL"); }