wkhtmltopdf pdf, a way to listen for when the process is complete?
===


I'm using wkhtmltopdf to generate some pdfs from a asp.net mvc site.  I'm using code found on another SO question [here][1].  There is a problem with this code in that there is a hard coded 60 second wait for the process to complete.  I think it would be much improved if we could simply have a trigger or signal to watch for then exit and read the output.  So does anyone know of a way to listen for a response from the wkhtmltopdf process?


     // 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(); 


  [1]: http://stackoverflow.com/questions/1331926/calling-wkhtmltopdf-to-generate-pdf-from-html/1698839#1698839