运用wkhtmltopdf导出pdf,导是可以导出来,目录显示出来了,但是现在的问题是不知道如何设置目录的样式,求教。代码如下:
string output = "";
string Lan = "CN";
string str = HttpContext.Current.Server.MapPath("../../wkhtml2pdf/wkhtmltopdf.exe");
string url = "http://localhost:32133/web/lawyer/tlawer/indexCV.aspx?Lan=" + Lan + "&l_id=" + curEmpID + "&D=" + new Random().NextDouble();
string _curpath = "../../wkhtml2pdf/" + Lan + "/" + curEmpID + ".pdf";
string path = HttpContext.Current.Server.MapPath(_curpath);
string switches = " --header-right \"" + dt_FILED2 .Rows[0][0].ToString()+ "\" --header-line --header-spacing 10 --margin-top 20 --footer-center [page] --toc --outline --outline-depth 4 --toc-header-text 目录 ";
Process p = new Process();
Boolean result = false;
ProcessStartInfo psi = new ProcessStartInfo(str, String.Format(" {0} {1} {2}", switches, url, path));
p.StartInfo.FileName = str;
p.StartInfo = psi;
p.StartInfo.UseShellExecute = false;
p.StartInfo.CreateNoWindow = true;
p.Start();
p.WaitForExit();
result = true;