title: How to get wkhtmltopdf logging info in C#?
body: <p>I'm using <a href="http://code.google.com/p/wkhtmltopdf/" rel="nofollow">wkhtmltopdf</a> to convert some html to pdf.  I think I'm getting some javascrpot errors and I'd like to get access to some debug\logging from wkhtmltopdf.  Does anyone know how to get the logging info?   </p>
  
  <pre><code>        var wkhtmlDir = Settings.HtmlToPdfFolderPath;
          var wkhtml = Settings.HtmlToPdfExePath;
          var p = new Process();
  
          p.StartInfo.CreateNoWindow = true;
          p.StartInfo.RedirectStandardOutput = true;
          p.StartInfo.RedirectStandardError = true;
          p.StartInfo.RedirectStandardInput = true;
          p.StartInfo.UseShellExecute = false;
          p.StartInfo.FileName = wkhtml;
          p.StartInfo.WorkingDirectory = wkhtmlDir;
  
          string switches = "";
          switches += "--print-media-type --redirect-delay 800 ";
          //switches += "--margin-top 10mm --margin-bottom 10mm --margin-right 10mm --margin-left 10mm ";
          switches += "--page-size Letter ";
          p.StartInfo.Arguments = switches + " " + url 
          p.Start();
  
          //read output
          byte[] buffer = new byte[32768];
          byte[] file;
          using (var ms = new MemoryStream())
          {
              while (true)
              {
                  int read = p.StandardOutput.BaseStream.Read(buffer, 0, buffer.Length);
  
                  if (read &lt;= 0)
                  {
                      break;
                  }
                  ms.Write(buffer, 0, read);
              }
              file = ms.ToArray();
          }
  
          // wait or exit
          p.WaitForExit(60000);
  
          // read the exit code, close process
          int returnCode = p.ExitCode;
          p.Close();
  
          //return returnCode == 0 ? file : null;
  
          return file;
  </code></pre>