{"id":3113,"date":"2013-09-27T10:41:18","date_gmt":"2013-09-27T02:41:18","guid":{"rendered":"https:\/\/kyle.ai\/blog\/?p=3113"},"modified":"2013-09-27T10:45:46","modified_gmt":"2013-09-27T02:45:46","slug":"%e4%bf%9d%e5%ad%98%e7%bd%91%e9%a1%b5%e4%b8%ba%e5%9b%be%e7%89%87%e6%88%96pdf%e6%96%b9%e6%b3%95%e6%80%bb%e7%bb%93","status":"publish","type":"post","link":"https:\/\/kyle.ai\/blog\/3113.html","title":{"rendered":"\u4fdd\u5b58\u7f51\u9875\u4e3a\u56fe\u7247\u6216PDF\u65b9\u6cd5\u603b\u7ed3"},"content":{"rendered":"<p><span style=\"font-size: medium;\">\u65b9\u6cd5\u4e00\uff1aChrome\u7684\u7f51\u9875\u622a\u56fe\u63d2\u4ef6<\/span><\/p>\n<p><a href=\"https:\/\/kyle.ai\/blog\/wp-content\/uploads\/2013\/09\/2013-09-27-094630\u7684\u5c4f\u5e55\u622a\u56fe.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-3114 alignnone\" title=\"2013-09-27 09:46:30\u7684\u5c4f\u5e55\u622a\u56fe\" src=\"https:\/\/kyle.ai\/blog\/wp-content\/uploads\/2013\/09\/2013-09-27-094630\u7684\u5c4f\u5e55\u622a\u56fe.png\" alt=\"\" width=\"309\" height=\"211\" srcset=\"https:\/\/kyle.ai\/blog\/wp-content\/uploads\/2013\/09\/2013-09-27-094630\u7684\u5c4f\u5e55\u622a\u56fe.png 309w, https:\/\/kyle.ai\/blog\/wp-content\/uploads\/2013\/09\/2013-09-27-094630\u7684\u5c4f\u5e55\u622a\u56fe-300x204.png 300w, https:\/\/kyle.ai\/blog\/wp-content\/uploads\/2013\/09\/2013-09-27-094630\u7684\u5c4f\u5e55\u622a\u56fe-219x150.png 219w\" sizes=\"auto, (max-width: 309px) 100vw, 309px\" \/><\/a><\/p>\n<p><span style=\"font-size: small;\">\u8fd9\u4e2a\u63d2\u4ef6\u53ef\u4ee5\u622a\u5b8c\u6574\u7f51\u9875\uff0c\u6216\u662f\u53ea\u622a\u53ef\u89c1\u533a\u57df\u3002<\/span><\/p>\n<p><span style=\"font-size: small;\">\u4e0d\u8fc7\u5c31\u6211\u4f7f\u7528\u6765\u770b\uff0c\u5f53\u7f51\u9875\u6709iframe\u6846\u67b6\u7684\u65f6\u5019\uff0c\u597d\u50cf\u5c31\u4e0d\u7075\u4e86\uff0c\u751a\u81f3\u5de5\u5177\u70b9\u51fb\u6ca1\u53cd\u5e94\u3002<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-size: medium;\">\u65b9\u6cd5\u4e8c\uff1awkhtmltopdf\u548cwkhtmltoimage\u547d\u4ee4<\/span><\/p>\n<p><span style=\"font-size: small;\">wkhtmltopdf\u9879\u76ee\u5730\u5740\uff1ahttps:\/\/code.google.com\/p\/wkhtmltopdf\/<\/span><\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nsudo apt-get install wkhtmltopdf\r\nwkhtmltopdf https:\/\/kyle.ai 1.pdf\r\n<\/pre>\n<p><span style=\"font-size: small;\">\u53ef\u4ee5\u5c06\u7f51\u9875\u4fdd\u5b58\u6210pdf\u6587\u4ef6\uff0ccss\u652f\u6301\u5f97\u6bd4\u8f83\u597d\uff0c\u4e2d\u6587\u7f16\u7801\u4e5f\u652f\u6301\u3002\u7f3a\u70b9\u662f\uff0cjs\u4e0d\u600e\u4e48\u652f\u6301\uff0c\u4f8b\u5982\u6293douban.com\uff0c\u56e0\u4e3a\u91cc\u9762\u6709\u5f88\u591a\u56fe\u7247\u90fd\u662f\u901a\u8fc7js\u505alazyload\uff0c\u6240\u4ee5\u6293\u56de\u6765\u7684\u9875\u9762\u56fe\u7247\u90fd\u663e\u793a\u4e0d\u51fa\u6765\u3002<\/span><\/p>\n<p><span style=\"font-size: small;\">\u540c\u65f6\u8fd8\u6709\u4e00\u4e2a\u547d\u4ee4\uff1awkhtmltoimage\uff0c\u53ef\u4ee5\u76f4\u63a5\u4fdd\u5b58\u4e3a\u56fe\u7247\u3002wkhtmltoimage\u8981\u53bb https:\/\/code.google.com\/p\/wkhtmltopdf\/downloads\/list \u4e0b\u8f7d\u3002<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-size: medium;\">\u65b9\u6cd5\u4e09\uff1aphantomjs<\/span><\/p>\n<p><span style=\"font-size: small;\">phantomjs \u662f\u4e00\u4e2a\u5f00\u6e90\u9879\u76ee\uff0c\u5730\u5740\uff1ahttps:\/\/github.com\/ariya\/phantomjs\/<\/span><\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nsudo apt-get install phantomjs\r\n<\/pre>\n<p><span style=\"font-size: small;\">\u65b0\u5efa\u4e00\u4e2ajs\u6587\u4ef6 github.js\uff1a<\/span><\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\nvar page = require('webpage').create();\r\npage.open('http:\/\/github.com\/', function () {\r\n    page.render('github.png');\r\n    phantom.exit();\r\n});\r\n<\/pre>\n<p><span style=\"font-size: small;\">\u7136\u540e\u8fd0\u884c\uff1a<\/span><\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\nphantomjs github.js\r\n<\/pre>\n<p><span style=\"font-size: small;\">\u5177\u4f53\u53ef\u4ee5\u770b\u4e0b\u6211\u4e4b\u524d\u5199\u7684\u6587\u7ae0\uff1a<a href=\"https:\/\/kyle.ai\/blog\/3046.html\">\u5229\u7528phantomjs\u8fdb\u884c\u7f51\u9875\u622a\u56fe<\/a><\/span><\/p>\n<p><span style=\"font-size: small;\">phantomjs \u53ef\u4ee5\u5b8c\u7f8e\u7684\u6a21\u62df\u6d4f\u89c8\u5668\u6e32\u67d3\u7f51\u9875\uff0cjs\u4e5f\u652f\u6301\u8f83\u597d\uff0c\u622a\u56fe\u4e0e\u539f\u7f51\u9875\u5339\u914d\u5ea6\u8f83\u9ad8\uff0c\u4f46\u662f\u4e5f\u6709\u53ef\u80fd\u8fdb\u884c\u4e00\u4e9b\u5b57\u4f53\u914d\u7f6e\uff0c\u5426\u5219\u51fa\u73b0\u4e2d\u6587\u4e71\u7801\u6216\u5b57\u4f53\u4e0d\u597d\u770b\u3002<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-size: medium;\">\u65b9\u6cd5\u56db\uff1agnome-web-photo\u547d\u4ee4\u548cShutter<\/span><\/p>\n<p><span style=\"font-size: small;\">gnome-web-photo\u547d\u4ee4\u53ef\u4ee5\u76f4\u63a5\u8fdb\u884c\u7f51\u9875\u622a\u56fe\uff0c\u6548\u679c\u4e5f\u6bd4\u8f83\u597d\u3002\u4f46\u662f\u540c\u6837\u4e5f\u4e0d\u592a\u652f\u6301js\u3002<\/span><\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nsudo apt-get install gnome-web-photo\r\ngnome-web-photo -t 0 -m photo https:\/\/kyle.ai lztian.png\r\n<\/pre>\n<p><span style=\"font-size: small;\">Shutter\u662fubuntu\u4e0a\u4e00\u4e2a\u622a\u56fe\u5de5\u5177\uff0c\u529f\u80fd\u6bd4\u8f83\u9f50\u5168\uff0c\u5982\u679c\u4f60\u5b89\u88c5\u4e86gnome-web-photo\uff0c\u90a3\u5728Shutter\u4e0a\u9762\u5c31\u6709\u4e00\u4e2a\u7f51\u9875\u622a\u5c4f\u7684\u529f\u80fd\u6309\u94ae\u3002<\/span><\/p>\n<p><a href=\"https:\/\/kyle.ai\/blog\/wp-content\/uploads\/2013\/09\/shutter-website-1-570x367.png\"><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-3115 alignnone\" title=\"shutter-website-1-570x367\" src=\"https:\/\/kyle.ai\/blog\/wp-content\/uploads\/2013\/09\/shutter-website-1-570x367.png\" alt=\"\" width=\"679\" height=\"438\" srcset=\"https:\/\/kyle.ai\/blog\/wp-content\/uploads\/2013\/09\/shutter-website-1-570x367.png 849w, https:\/\/kyle.ai\/blog\/wp-content\/uploads\/2013\/09\/shutter-website-1-570x367-300x193.png 300w, https:\/\/kyle.ai\/blog\/wp-content\/uploads\/2013\/09\/shutter-website-1-570x367-232x150.png 232w\" sizes=\"auto, (max-width: 679px) 100vw, 679px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-size: medium;\">\u65b9\u6cd5\u4e94\uff1aChrome\u7684\u6253\u5370\u529f\u80fd<\/span><\/p>\n<p><span style=\"font-size: small;\">\u5f53\u6253\u5f00\u4e00\u4e2a\u7f51\u9875\u540e\uff0cChrome\u6d4f\u89c8\u5668\u7684\u6273\u624b\u83dc\u5355\u4e2d\uff0c\u70b9\u51fb\u201c\u6253\u5370\u201d\uff0c\u7136\u540e\u5728\u6253\u5370\u754c\u9762\u4e2d\uff0c\u70b9\u51fb\u201c\u4fdd\u5b58\u201d\uff0c\u5c31\u53ef\u4ee5\u76f4\u63a5\u5c06\u5f53\u524d\u7f51\u9875\u4fdd\u5b58\u4e3aPDF\u6587\u6863\uff0c\u5f88\u65b9\u4fbf\u3002<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u65b9\u6cd5\u4e00\uff1aChrome\u7684\u7f51\u9875\u622a\u56fe\u63d2\u4ef6 \u8fd9\u4e2a\u63d2\u4ef6\u53ef\u4ee5\u622a\u5b8c\u6574\u7f51\u9875\uff0c\u6216\u662f\u53ea\u622a\u53ef\u89c1\u533a\u57df\u3002 \u4e0d\u8fc7\u5c31\u6211\u4f7f\u7528\u6765\u770b\uff0c\u5f53\u7f51\u9875\u6709if [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-3113","post","type-post","status-publish","format-standard","hentry","category-diary"],"_links":{"self":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts\/3113","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/comments?post=3113"}],"version-history":[{"count":4,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts\/3113\/revisions"}],"predecessor-version":[{"id":3119,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts\/3113\/revisions\/3119"}],"wp:attachment":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/media?parent=3113"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/categories?post=3113"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/tags?post=3113"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}