我在 Windows Server 2008 R2 上运行 IIS 7.5,我试图在上传后使用 SWFTools 的 pdf2swf 将一些 PDF 转换为 SWF。如果我用相同的参数手动启动转换器,一切都很好。但是,如果我从我的 HttpHandler 中启动转换器,该过程要么不返回任何输出(并且似乎根本没有启动),要么在没有任何文本的情况下转换 PDF - 取决于我如何启动该过程。
我是这样开始这个过程的:
System.Diagnostics.Process p = new System.Diagnostics.Process();
p.StartInfo.FileName = ToolsPath;
p.StartInfo.Arguments = arguments
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.RedirectStandardError = true;
p.StartInfo.Password = secPw;
p.StartInfo.UserName = username;
p.StartInfo.Domain = domain;
p.Start();
p.WaitForExit();
以及我传递的参数:
"%%source%% -o %%target%% -v -v -v -f -T 9 -t -s storeallcharacters"
非常感谢您的帮助!
编辑: 我也尝试过不使用额外的 StartInfo(用户凭据),这是我第一次尝试的方法,结果生成了没有文本的 SWF。使用凭据(作为管理员或标准)我没有从转换器获得任何 SWF 或输出。
编辑 2: 我也尝试了这些论点:
"%%source%% -o %%target%% -f -T 9 -t -s storeallcharacters"
最佳答案
好的,我通过添加一个具有管理权限的单独控制台应用程序解决了这个问题:我添加了一个应用程序 list
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
此控制台应用程序称为 pdf2swf.exe,由我的 HttpHandler 调用。
我还在我的 HttpHandler 中添加了“中间人”的调用这些代码行:
p.StartInfo.UseShellExecute = false;
if (System.Environment.OSVersion.Version.Major >= 6)
p.StartInfo.Verb = "runas";
关于c# - SWFTools 的 pdf2swf : No text converted if started from IIS-hosted website,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10137401/