首页 新闻 赞助 找找看

asp.net pdf2swf无法再程序里面生成,只能在dos里生成,是怎么改的?

0
悬赏园豆:30 [已解决问题] 解决于 2011-02-25 08:28

我的是asp.net项目,xp系统,环境是vs2008文件

protected void Page_Load(object sender, EventArgs e)
  {
  if (!IsPostBack)
  {
  try
  {

  System.Diagnostics.Process p = new Process();

  p.StartInfo.FileName = "cmd";

  p.StartInfo.UseShellExecute = false;

  p.StartInfo.RedirectStandardInput = true;

  p.StartInfo.RedirectStandardOutput = true;

  p.StartInfo.RedirectStandardError = true;

  p.StartInfo.CreateNoWindow = true;

  p.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;

  p.Start();

  string strOutput = null;

  string s = @"C:\SWFTools\pdf2swf.exe " + Server.MapPath("~/Files/1.pdf") + " -o " + Server.MapPath("~/Files/1.swf");

  p.StandardInput.WriteLine(s);

  p.StandardInput.WriteLine("exit");

  strOutput = p.StandardOutput.ReadToEnd();

  Console.WriteLine(strOutput);

  p.WaitForExit();

  p.Close();

  // lblMessage.Text = "success";

  }

  catch (Exception ex)
  {

  // lblMessage.Text = ex.ToString();

  }
  }
  }
 
liujiana的主页 liujiana | 初学一级 | 园豆:170
提问于:2011-02-22 14:00
< >
分享
最佳答案
0

p.StartInfo.FileName = "cmd";

这一句写错了,这里应该是SWFTOOLS的安装路径

参考:http://www.cnblogs.com/sobne/articles/1822479.html

http://dotnetslackers.com/Community/blogs/haissam/archive/2008/03/14/convert-pdf-to-swf-in-asp-net.aspx

收获园豆:30
artwl | 专家六级 |园豆:16736 | 2011-02-22 15:15
其他回答(1)
0

fonts文件夹权限问题

N_unknown | 园豆:204 (菜鸟二级) | 2012-08-13 14:09
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册