FlexPaper實(shí)現(xiàn)文檔在線瀏覽
當(dāng)前位置:點(diǎn)晴教程→知識(shí)管理交流
→『 技術(shù)文檔交流 』
最近有看到網(wǎng)友在做文檔在線瀏覽,剛開(kāi)始時(shí),Insus.NeT是想使用FlashPaper 2來(lái)實(shí)現(xiàn),由于自己的開(kāi)發(fā)環(huán)境是Win7 64bit的,一直找不到FlashPaper 2的64bit的驅(qū)動(dòng),最后Insus.NET只好使用FlexPaper來(lái)實(shí)現(xiàn)了,F(xiàn)lexPaper有點(diǎn)不好,就是在瀏覽時(shí),右下角有一個(gè)About Logo,如果文檔放大瀏覽時(shí),不小心會(huì)打開(kāi)About的小窗口。心得與經(jīng)驗(yàn)寫(xiě)于此,方便真正應(yīng)用時(shí),以備查閱。 實(shí)現(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)換之后的文檔,從后臺(tái)這里傳入。 this.Literal1.Text = "var swfFile = ''" + swfFile + " ''"; }
最后是,文件轉(zhuǎn)換為swf。轉(zhuǎn)換工具在網(wǎng)上也很多,如SWFTools,下載地址:http://www.swftools.org/??茨銓?shí)際情況,你可以在文件上傳時(shí),做文檔轉(zhuǎn)為swf文檔,也可以在用戶瀏覽時(shí),再做轉(zhuǎn)換。下面是一個(gè)簡(jiǎn)單語(yǔ)法:
最后是附帶上程序碼(不包含轉(zhuǎn)換功能): http://download.cnblogs.com/insus/ASPDOTNET/FlexPaperView.rar 該文章在 2017/11/16 23:57:23 編輯過(guò) |
關(guān)鍵字查詢
相關(guān)文章
正在查詢... |