本文以Google Chrome瀏覽器舉例:
需求:將熊博主的首頁製作成pdf
- 打開要製作成pdf的網頁,如:
熊博主的首頁
- 按住
F12
或者Fn+F12
,打開開發者工具,到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();
})();
回車,就會打開以下界面:
然後就可以將pdf保存到指定的位置了。