私はwkhtmltopdfを使用して、asp.netmvcサイトからいくつかのpdfを生成しています。ここで別のSOの質問にあるコードを使用しています。このコードには、プロセスが完了するまでハードコードされた60秒の待機があるという問題があります。トリガーまたはシグナルを監視して終了し、出力を読み取ることができれば、はるかに改善されると思います。では、wkhtmltopdfプロセスからの応答をリッスンする方法を知っている人はいますか?
// read the output here...
string output = p.StandardOutput.ReadToEnd();
// ...then wait n milliseconds for exit (as after exit, it can't read the output)
p.WaitForExit(60000);
// read the exit code, close process
int returnCode = p.ExitCode;
p.Close();