.net如何实现word、pdf、PPT等文件的在线阅读?

fthislife 2013-10-28 10:01:34
如题,可以允许用户在线查看等,但不允许用户下载,即不能使用本地的pdf\word等软件打开也能查看,因为这样的话别人可以另存为。。,请问有什么控件能实现的?
...全文
112 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
  • 打赏
  • 举报
回复
以前看过的源码,再好的控件不如自己写。 类似百度文库在线预览文档flash版
马老虎 2013-10-28
  • 打赏
  • 举报
回复
一般都是采用 flash 进行查看的。
【核心代码】 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 using Aspose.Cells; using Aspose.Slides.Pptx; using System; using System.Collections.Generic; using System.Data; using System.IO; using System.Linq; using System.Net; using System.Net.Http; using System.Text; using System.Web.Http; namespace DocOnlineView.UI.Controllers.MVCAPI { public class HomeController : ApiController { [HttpGet] public DataTable CourseViewOnLine(string fileName) { DataTable dtlist = new DataTable(); dtlist.Columns.Add("TempDocHtml", typeof(string)); string fileDire = "/Files"; string sourceDoc = Path.Combine(fileDire, fileName); string saveDoc = ""; string docExtendName = System.IO.Path.GetExtension(sourceDoc).ToLower(); bool result = false; if (docExtendName == ".pdf") { //pdf模板文件 string tempFile = Path.Combine(fileDire, "temppdf.html"); saveDoc = Path.Combine(fileDire, "viewFiles/onlinepdf.html"); result = PdfToHtml( sourceDoc, System.Web.HttpContext.Current.Server.MapPath(tempFile), System.Web.HttpContext.Current.Server.MapPath(saveDoc)); } else { saveDoc = Path.Combine(fileDire, "viewFiles/onlineview.html"); result = OfficeDocumentToHtml( System.Web.HttpContext.Current.Server.MapPath(sourceDoc), System.Web.HttpContext.Current.Server.MapPath(saveDoc)); }

110,539

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧