HTML页面(博客内容)转为PDF保存到本地

1.打开谷歌浏览器控制台(F12) 

2.在console中粘贴如下内容

(function(){
$("#side").remove();
$("#comment_title, #comment_list, #comment_bar, #comment_form, .announce, #ad_cen, #ad_bot").remove();
$(".nav_top_2011, #header, #navigator").remove();
$(".p4course_target, .comment-box, .recommend-box, #csdn-toolbar, #tool-box").remove();
$("aside").remove();
$(".tool-box").remove();
$("main").css('display','content'); 
$("main").css('float','left'); 
window.print();

$("tool-box").remove();
})();

3.回车运行就可以了

猜你喜欢

转载自blog.csdn.net/weixin_37906108/article/details/90713335