日韩天天综合网_野战两个奶头被亲到高潮_亚洲日韩欧美精品综合_av女人天堂污污污_视频一区**字幕无弹窗_国产亚洲欧美小视频_国内性爱精品在线免费视频_国产一级电影在线播放_日韩欧美内地福利_亚洲一二三不卡片区

.NET實(shí)現(xiàn)在網(wǎng)頁中預(yù)覽Office文件的3個(gè)方法(4)_.Net教程

編輯Tag賺U幣
教程Tag:暫無Tag,歡迎添加,賺取U幣!

推薦:asp.net中控制反轉(zhuǎn)怎么理解?
對(duì)IOC的解釋為:Inversion of control is a common characteristic of frameworks, so saying that these lightweight containers are special because they use inversion of control is like saying my car is special because it has wheels. 我想對(duì)這一概念執(zhí)行

        #region 2.02 轉(zhuǎn)換PDF文件為SWF格式 +PDFConvertToSwf(string pdfPath, string swfPath, int page)
        /// <summary>
        /// 轉(zhuǎn)換PDF文件為SWF格式
        /// </summary>
        /// <param name="pdfPath">PDF文件路徑</param>
        /// <param name="swfPath">SWF生成目標(biāo)文件路徑</param>
        /// <param name="page">PDF頁數(shù)</param>
        /// <returns>生成是否成功</returns>
        public static bool PDFConvertToSwf(string pdfPath, string swfPath, int page)
        {
            StringBuilder sb = new StringBuilder();
            sb.Append(" \"" + pdfPath + "\"");
            sb.Append(" -o \"" + swfPath + "\"");
            sb.Append(" -z");
            //flash version
            sb.Append(" -s flashversion=9");
            //禁止PDF里面的鏈接
            sb.Append(" -s disablelinks");
            //PDF頁數(shù)
            sb.Append(" -p " + "\"1" + "-" + page + "\"");
            //SWF中的圖片質(zhì)量
            sb.Append(" -j 100");
            string command = sb.ToString();
            System.Diagnostics.Process p = null;
            try
            {
                using (p = new System.Diagnostics.Process())
                {
                    p.StartInfo.FileName = _EXEFILENAME;
                    p.StartInfo.Arguments = command;
                    p.StartInfo.WorkingDirectory = System.IO.Path.GetDirectoryName(_EXEFILENAME);
                    //不使用操作系統(tǒng)外殼程序 啟動(dòng) 線程
                    p.StartInfo.UseShellExecute = false;
                    //p.StartInfo.RedirectStandardInput = true;
                    //p.StartInfo.RedirectStandardOutput = true;

                    //把外部程序錯(cuò)誤輸出寫到StandardError流中(pdf2swf.exe的所有輸出信息,都為錯(cuò)誤輸出流,用 StandardOutput是捕獲不到任何消息的...
                    p.StartInfo.RedirectStandardError = true;
                    //不創(chuàng)建進(jìn)程窗口
                    p.StartInfo.CreateNoWindow = false;
                    //啟動(dòng)進(jìn)程
                    p.Start();
                    //開始異步讀取
                    p.BeginErrorReadLine();
                    //等待完成
                    p.WaitForExit();
                }
            }
            catch (Exception ex)
            {
                Souxuexiao.API.Logger.error(string.Format("轉(zhuǎn)換PDF文件為SWF格式執(zhí)行PDFConvertToSwf函數(shù)發(fā)生異常原因是:{0}", ex.Message));
            }
            finally
            {
                if (p != null)
                {
                    //關(guān)閉進(jìn)程
                    p.Close();
                    //釋放資源
                    p.Dispose();
                }
            }
            return File.Exists(swfPath);
        }
        #endregion
    }
}
Office格式轉(zhuǎn)換

 

3、將pdf文件轉(zhuǎn)swf的轉(zhuǎn)換器放到站點(diǎn)根目錄下新建文件夾pdf2swf(我就是這么配置的,您隨意)

4、配置FlexPaper

預(yù)覽頁面引用

分享:delphi選擇文件夾例子
所需單元 示例代碼

來源:模板無憂//所屬分類:.Net教程/更新時(shí)間:2014-10-11
相關(guān).Net教程