如何打印CSDN博客博文(save as PDF)

具体步骤

1、在需要打印的CSDN博客页空白处右键,选择“检查/审查元素”;
2、点击上面一栏中的console
3、将下面的代码粘贴回车 ,就会自动跳转到打印界面。
在这里插入图片描述

源代码

(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();
})();

Reference:怎么打印CSDN博客博文 把CSDN博客保存成PDF

猜你喜欢

转载自blog.csdn.net/qq_36056219/article/details/111303934