SWFTools的pdf2swf:如果从IIS托管的网站启动,则不会转换任何文本 [英] SWFTools' pdf2swf: No text converted if started from IIS-hosted website

查看:113
本文介绍了SWFTools的pdf2swf:如果从IIS托管的网站启动,则不会转换任何文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Windows Server 2008 R2上运行IIS 7.5,并且正在尝试使用SWFTools的pdf2swf将一些PDF转换为SWF之后进行转换.如果我使用相同的参数手动启动转换器,一切都很好.但是,如果我从HttpHandler中启动转换器,则该过程不会返回任何输出(并且似乎根本不会启动),或者转换不带任何文本的PDF,这取决于我如何启动该过程.

I'm running IIS 7.5 on a Windows Server 2008 R2, and I'm trying to convert some PDFs after the upload into SWFs with SWFTools' pdf2swf. If I start the converter manually with the same arguments, everything is fine. But if I start the converter from within my HttpHandler, either the process does not return any output (and does not seem to be started at all) or converts the PDF without any text - depending on how I start the process.

这是我开始流程的方式:

Here is how I start the process:

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或输出.

I also tried it without the additional StartInfo (the user-credentials), this was what I first tried, which resulted in a SWF without Text. With the credentials (as admin or standard) I do not get any SWF or output from the converter.

我也尝试了这些参数:

Edit 2: I also tried those arguments:

"%%source%% -o %%target%% -f -T 9 -t -s storeallcharacters"

推荐答案

好吧,我通过添加具有管理权限的单独控制台应用程序解决了该问题:我添加了带有

Okay, I solved the issue by adding a seperate console application with administrative-rights: I added an application manifest with

<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />

此控制台应用程序名为pdf2swf.exe,由我的HttpHandler调用.

This console application called the pdf2swf.exe and is called by my HttpHandler.

我还在我的HttpHandler的中间人"的调用中添加了以下代码行:

Also I added to the call of the "middleman" in my HttpHandler those lines of code:

p.StartInfo.UseShellExecute = false;
if (System.Environment.OSVersion.Version.Major >= 6)
    p.StartInfo.Verb = "runas";

这篇关于SWFTools的pdf2swf:如果从IIS托管的网站启动,则不会转换任何文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆