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; }
先将doc转为pdf(可以使用Aspose.Words),再用pdf2swf.exe转成swf,可以查查资料,网上有很多示例代码
嗯呢,好的谢谢