csharp 适用于.NET MVC Modern UI的GroupDocs.Viewer

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了csharp 适用于.NET MVC Modern UI的GroupDocs.Viewer相关的知识,希望对你有一定的参考价值。

using GroupDocs.Viewer.Handler;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Viewer_Modren_UI.Helpers;

namespace Viewer_Modren_UI.Controllers
{
    [RoutePrefix("download/original")]
    public class DownloadOriginalController : Controller
    {
        [Route("")]
        public ActionResult Get(string file)
        {
            ViewerHtmlHandler handler = Utils.CreateViewerHtmlHandler();
            Stream original = null;
            try
            {
                original = handler.GetFile(file).Stream;
            }
            catch (Exception x)
            {
                throw x;
            }

            using (var ms = new MemoryStream())
            {
                original.CopyTo(ms);
                return File(ms.ToArray(), "application/octet-stream", file);
            }
        }
    }
}

以上是关于csharp 适用于.NET MVC Modern UI的GroupDocs.Viewer的主要内容,如果未能解决你的问题,请参考以下文章

csharp 适用于.NET MVC Modern UI的GroupDocs.Viewer

csharp 适用于.NET MVC Modern UI的GroupDocs.Viewer

csharp 适用于.NET MVC Modern UI的GroupDocs.Viewer

csharp 适用于.NET MVC Modern UI的GroupDocs.Viewer

csharp 适用于.NET MVC Modern UI的GroupDocs.Viewer

csharp 适用于.NET MVC Modern UI的GroupDocs.Viewer