FlexPaper實現(xiàn)文檔在線瀏覽
當(dāng)前位置:點晴教程→知識管理交流
→『 技術(shù)文檔交流 』
最近有看到網(wǎng)友在做文檔在線瀏覽,剛開始時,Insus.NeT是想使用FlashPaper 2來實現(xiàn),由于自己的開發(fā)環(huán)境是Win7 64bit的,一直找不到FlashPaper 2的64bit的驅(qū)動,最后Insus.NET只好使用FlexPaper來實現(xiàn)了,F(xiàn)lexPaper有點不好,就是在瀏覽時,右下角有一個About Logo,如果文檔放大瀏覽時,不小心會打開About的小窗口。心得與經(jīng)驗寫于此,方便真正應(yīng)用時,以備查閱。 實現(xiàn)之后效果如下:
.aspx: <script src="js/swfobject/swfobject.js" type="text/javascript"></script> <script src="js/flexpaper_flash_debug.js" type="text/javascript"></script> <script src="Scripts/jquery-1.4.1.js" type="text/javascript"></script> <script type="text/javascript"> <asp:Literal ID="Literal1" runat="server"></asp:Literal> </script> <script src="js/InsusDocumentView.js" type="text/javascript"></script> <div style="position: absolute; left: 3px; top: 3px;" align="center"> <div id="flashContent"> <p> To view this page ensure that Adobe Flash Player version 10.0.0 or greater is installed. </p> <script type="text/javascript"> var pageHost = ((document.location.protocol == "https:") ? "https://" : "http://"); document.write("<a href=''http://www.adobe.com/go/getflashplayer''><img src=''" + pageHost + "www.adobe.com/images/shared/download_buttons/get_flash_player.gif'' alt=''Get Adobe Flash player'' /></a>"); </script> </div> </div>
.cs: protected void Page_Load(object sender, EventArgs e) { string swfFile = "Swf/view.swf"; //轉(zhuǎn)換之后的文檔,從后臺這里傳入。 this.Literal1.Text = "var swfFile = ''" + swfFile + " ''"; }
最后是,文件轉(zhuǎn)換為swf。轉(zhuǎn)換工具在網(wǎng)上也很多,如SWFTools,下載地址:http://www.swftools.org/。看你實際情況,你可以在文件上傳時,做文檔轉(zhuǎn)為swf文檔,也可以在用戶瀏覽時,再做轉(zhuǎn)換。下面是一個簡單語法:
最后是附帶上程序碼(不包含轉(zhuǎn)換功能): http://download.cnblogs.com/insus/ASPDOTNET/FlexPaperView.rar 該文章在 2017/11/16 23:57:23 編輯過 |
關(guān)鍵字查詢
相關(guān)文章
正在查詢... |