JS 方法
<style>
.no-print {
cursor:pointer;
}
@media print {
.no-print, .no-print * {
display: none !important;
}
}
</style>
<script>
function printHtml() {
window.print();
}
</script>
<div style="text-align:center">
<img class="no-print" src="${staticContextPath}/img/print.png" onclick="printHtml()"/>
</div>
<br>
wkhtmltox
wkhtmltopdf [index.html | www.baidu.com] result.pdf