aspose 在线展示word、excel文档

时间:2022-11-07 20:26:27
aspose 在线展示word、excel文档aspose 在线展示word、excel文档View Code
  string file = Server.MapPath( " Library/现场服务商评价日报.xls ");
            Workbook workbook =  new Workbook(file);
            HtmlSaveOptions option =  new HtmlSaveOptions(SaveFormat.Html);
            System.IO.MemoryStream stream =  new System.IO.MemoryStream();
            workbook.Save(stream, SaveFormat.Html);
             string html = System.Text.Encoding.UTF8.GetString(stream.ToArray());
            HttpContext.Current.Response.ContentType =  " text/html; charset=utf-8 ";
            HttpContext.Current.Response.Write(html);
            HttpContext.Current.Response.Flush();
            HttpContext.Current.Response.End();

aspose 在线展示word、excel文档aspose 在线展示word、excel文档View Code

string fullpath = Server.MapPath( " Document/Template/a.doc ");
        Document doc =  new Document(fullpath, LoadFormat.Doc,  null);
        doc.Save( " a.mhtml ", SaveFormat.Mhtml, SaveType.OpenInBrowser, HttpContext.Current.Response);