Example #1
0
        public string Convert(Stream stream)
        {
            DocToDocx        docToDocx = new DocToDocx();
            MemoryStream     ms        = docToDocx.ConvertFromStreamToDocxMemoryStream(stream);
            DocxFromDocToXml docxToXml = new DocxFromDocToXml();
            string           xml       = docxToXml.Convert(ms);

            return(xml);
        }
Example #2
0
 public string ConvertByFile(string path)
 {
     if (!Path.IsPathFullyQualified(path))
     {
         path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, path);
     }
     using (FileStream fs = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
     {
         DocToDocx        docToDocx = new DocToDocx();
         MemoryStream     ms        = docToDocx.ConvertFromStreamToDocxMemoryStream(fs);
         DocxFromDocToXml docxToXml = new DocxFromDocToXml();
         string           xml       = docxToXml.Convert(ms);
         return(xml);
     }
 }