wkhtmltopdf
ASP.NETでHTMLページをPDFに変換するために使用しています。以下は私のコーディングです
protected void Button_Click(object sender, EventArgs e)
{
Process p = new Process();
p.StartInfo = new ProcessStartInfo();
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.FileName = Server.MapPath("~/wkhtmltopdf/wkhtmltopdf.exe");
string arguments = "\"" + "http://localhost:51528/settings/InvoiceStatementPrint.aspx?InvoiceID=48\"" + " " + Server.MapPath("~/settings/" + "InvoiceDetail_1.pdf");
p.StartInfo.Arguments = arguments;
p.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
p.StartInfo.CreateNoWindow = true;
p.Start();
p.WaitForExit();
p.Close();
p.Dispose();
}
URL は適切なページを作成します。ただし、 InvoiceDetail_1.pdf
黒いページの PDF が生成されます。私のコードに何か問題がありますか?