用FlashPrinter.exe把所有可打印的文件转换成swf文件.docVIP

  • 20
  • 0
  • 约1.88千字
  • 约 3页
  • 2017-07-28 发布于浙江
  • 举报

用FlashPrinter.exe把所有可打印的文件转换成swf文件.doc

用FlashPrinter.exe把所有可打印的文件转换成swf文件

解决:通过 调用FlashPrinter.exe把所有可打印的文件转换成swf文件 作者:sontin 日期:2010-11-20 字体大小: 小 中 大 FlashPaper干嘛用的?加个连接:/share/detail FlashPaper是一个虚拟打印机,可将word文件转化成swf格式文件(.doc .xls .txt .pdf等文件都可以正常生成SWF格式)。最近简单学习了在ASP.NET页面中调用FlashPaper将word文件转化成swf格式文件的方法。 (1)安装FlashPape:下载FlashPape压缩包,解压缩后,运行初始化目录中的初始化.bat,然后安装FlashPaperDriverInstall2.exe,即FlashPaper打印机。特别注意,在有的机器上要更改Macromedia FlashPape的端口,应为FlashPape2PrinterPort,如果是LPT1这个端口,当然打印不出来了。 (2)为页面中的按钮编写事件处理代码: 程序代码 Process process = new Process();???? //创建进程对象 ????????//try ????????//{ ????????????ProcessStartInfo startInfo = new ProcessStartInfo(); ????????????string paperroot = @C:\Program Files\Macromedia\FlashPaper 2\FlashPrinter.exe; ????????????string docFile = Server.MapPath(1.doc); ????????????string swfFile = Server.MapPath(1.swf); ????????????startInfo.FileName = paperroot; ????????????startInfo.Arguments = docFile + -o + swfFile; ????????????startInfo.UseShellExecute = false;???? //不使用系统外壳程序启动 ????????????startInfo.RedirectStandardInput = false;?? //不重定向输入 ????????????startInfo.RedirectStandardOutput = false;?? //重定向输出 ????????????startInfo.CreateNoWindow = true;???? //不创建窗口 ????????????process.StartInfo = startInfo; ????????????process.Start(); ????????????Response.Write(已经提交生成。br /); ????????????Response.Write(paperroot+br /+docFile + = + swfFile); ????????//} ????????//catch (Exception ex) ????????//{ ????????//????Response.Write(ex.Message); ????????//} ????????//finally ????????//{ ????????????if (process != null) ????????????????process.Close(); ????????//????Response.Write(br /finally); ????????//} 注意:有人说,FlashPrinter.exe所在的目录名称中不能有空格,否则转换失败。其实我上面的不不带空格了它同样转换成功了。 还碰到权限问题,简单的解决方法如下: ???? 在Windows xp系统下请把aspnet账号(如果是vista,则是networkservice)添加至administrators组,并重启iis admin服务。 ???? 在 windows server 2003下不用说了吧。一样是 networkservice 并重启iis admin服务。就这样问题搞了我半夜半天。

文档评论(0)

1亿VIP精品文档

相关文档