1

.docx、.doc ファイルを .ps ファイルに変換しています。ローカル マシンで正常に動作し、.ps ファイルを印刷しますが、IIS 7.5 では印刷されず、このエラーが発生します

"ActiveX-Server が開始されていません! 関数 "cStart()" を使用して ActiveX-Server を開始してください!"

私は cStart("/NoProcessingAtStartup", false) を試してみましたが、運が悪く、複数の検索を行っても解決しませんでした。誰かが前にこのようなものに出くわしたことがありますか?

IIS: 匿名認証、アプリケーション プール ID

PDFCreator.clsPDFCreator creator = new PDFCreator.clsPDFCreator();
PDFCreator.clsPDFCreatorOptions options = new PDFCreator.clsPDFCreatorOptions();
options = creator.cOptions;
PDFCreator.clsPDFCreatorError perr = new PDFCreator.clsPDFCreatorError();

if (!creator.cStart("/NoProcessingAtStartup", false))
{
     Console.Write("Can't Initiase PDF Converter, letter Generation Error");
}

options.UseAutosave = 1;
options.UseAutosaveDirectory = 1;
options.AutosaveDirectory = path;
options.AutosaveFilename = name;
options.AutosaveFormat = 6; //0=PDF, 1=PNG, 2=JPG, 3=BMP, 4=PCX, 5=TIFF, 6=PS, 7= EPS, 8=ASCII
creator.cOptions = options;
creator.cSaveOptions();
creator.cClearCache();
creator.cPrinterStop = false;
creator.cDefaultPrinter = "PDFCreator";
creator.cPrintFile(pathFull);

err = creator.cError.Description.ToString();
4

1 に答える 1

0

It is probably because the Application Pool User doesn't have permission to run PDFCreator or because it's never run PDFCreator before and on first run it's trying to do some installation or setup interactively and the Application Pool User doesn't have an interactive context. Although I would lean towards the latter as I'd expect a different error if it was the former.

If PDFCreator is accessible via the DCOM config section in Computer Management/Component Services then you could try setting it to always run as under a specific user identity, probably your own. You would also need to give the Application Pool User permission Launch and Activiation and Access permissions on it.

Alternatively you could try impersonation either in your application config or code and impersonate the account you'd normally use with PDFCreator.

Update: Although Word was the actual problem and PDFCreator was trying to activate it, the above suggestions still apply exactly.
If another process is trying to activate Word the user running that process will need to have DCOM permissions on it, and Word will probably need to be run as a specific user if the activating process user doesn't have permission or has never used it before.

As a specific example, say you're running the process under the Network Service account and it tries to activate Word, when a new user tries to run Word for the first time Word will throw up some installation windows for first time configuration, but since the user is not interactively logged in these windows cannot be seen and cannot be responded to so the installation hangs. In this case it is better to set Word to always start up under a specific identity in the DCOM config.

于 2012-06-13T16:00:24.107 に答える