1.插件下载地址:http://wkhtmltopdf.org/downloads.html,如果要在代码中使用的话需要下载免安装的版本。
2.执行语句:wkhtmltopdf.exe 需要转换的文件路径(获取URL) 保存的文件路径
事例代码:
1.构造HTML代码,待$号的为待替换的内容
string strHtml = "<html>" +
" <head>" +
" <meta http-equiv='Content-Type' content='text/html; charset=utf-8' />" +
" <title></title>" +
" </head>" +
" <body>" +
" <div style='padding: 20px 40px;border: 0px;'>" +
" <h3 style='display: block;font-family: inherit;font-weight: 600;font-size: 32px;line-height:67px;text-align: center;border-bottom: 1px solid;margin-bottom: 25px;margin-top:0px