首页 新闻 会员 周边

哪位大神知道怎么将doc文件转换为swf存储啊

0
悬赏园豆:5 [已解决问题] 解决于 2016-07-18 11:19
 public bool ConvertPdfToSwf(string inFilename, string swfFilename)
        {
            bool isStart;
            Process process = new Process();
            try
            {
                string flashPrinter = Server.MapPath("~/FlashPrinter/FlashPrinter.exe");
                FileInfo fileinfo = new FileInfo(inFilename);
                ProcessStartInfo startInfo = new ProcessStartInfo(flashPrinter);
                int time = ((int)(fileinfo.Length / (1024 * 1204))) * 20 + 20;
                startInfo.Arguments = string.Concat(inFilename, " -o ", swfFilename);
                startInfo.UseShellExecute = false;//不使用系统外壳程序启动
                startInfo.RedirectStandardInput = false;//不定向输入
                startInfo.RedirectStandardOutput = false;//不定向输出
                startInfo.CreateNoWindow = true;//不创建CMD窗口
                startInfo.RedirectStandardError = true;
                startInfo.WindowStyle = ProcessWindowStyle.Hidden;
                process.StartInfo = startInfo;
                isStart = process.Start();
                process.WaitForExit(time * 1000);
                process.Close();
                //process.Kill();
                process.Dispose();
                
                //while (!File.Exists(swfFilename))
                //{
                //    Thread.Sleep(1);
                //}
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (process != null)
                {

                    process.Close();

                }
            }
            return isStart;
        }
安东尼的不二的主页 安东尼的不二 | 初学一级 | 园豆:195
提问于:2016-07-12 17:29
< >
分享
最佳答案
0

先将doc转为pdf(可以使用Aspose.Words),再用pdf2swf.exe转成swf,可以查查资料,网上有很多示例代码

收获园豆:5
烽火情怀 | 菜鸟二级 |园豆:380 | 2016-07-14 14:24

嗯呢,好的谢谢

安东尼的不二 | 园豆:195 (初学一级) | 2016-07-18 11:18
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册