wkhtmltopdf 生成带封面、页眉、页脚、目录的pdf


 

wkhtmltopdf -T 15mm --header-spacing 5 --outline cover http://image.baidu.com --header-html file:///C:/Program%20Files/wkhtmltopdf/bin/a.html --header-line --footer-center "[page]/[topage]" --footer-line toc --toc-header-text "目录" http://www.yaolan.com/zhishi/tinglishaicha/ t2.pdf 

 a.html

<!DOCTYPE html>
<html>
<head>
<title>pdf</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<p>
<table style="width: 960px; border-bottom: 1px solid black;">
  <tr>
    <td>Shandong OPT Petroleum Engineering & Technology Co.,Ltd.</td>  
    <td><img src="logo.png" alt="logo" style="height:40px;" /></td>  
  </tr>
</table>
</body>
</html>

参考:

http://blog.csdn.net/w520hua/article/details/12573697

http://madalgo.au.dk/~jakobt/wkhtmltoxdoc/wkhtmltopdf-0.9.9-doc.html

http://wkhtmltopdf.org/usage/wkhtmltopdf.txt

http://blog.163.com/songchao01230@126/blog/static/1161848722014222231114/

你可能感兴趣的:(wkhtmltopdf)