{"id":156970,"date":"2019-09-12T09:40:54","date_gmt":"2019-09-12T01:40:54","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=156970"},"modified":"2019-09-04T09:36:39","modified_gmt":"2019-09-04T01:36:39","slug":"pdf-command","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/pdf-command.html","title":{"rendered":"PDF \u7684\u547d\u4ee4\u884c\u64cd\u4f5c"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\npdftk \u547d\u4ee4\u63d0\u4f9b\u4e86\u8bb8\u591a\u5904\u7406 PDF \u7684\u547d\u4ee4\u884c\u64cd\u4f5c\uff0c\u5305\u62ec\u5408\u5e76\u9875\u9762\u3001\u52a0\u5bc6\u6587\u4ef6\u3001\u6dfb\u52a0\u6c34\u5370\u3001\u538b\u7f29\u6587\u4ef6\uff0c\u751a\u81f3\u8fd8\u6709\u4fee\u590d PDF\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\u867d\u7136 PDF \u901a\u5e38\u88ab\u8ba4\u4e3a\u662f\u76f8\u5f53\u7a33\u5b9a\u7684\u6587\u4ef6\uff0c\u4f46\u5728 Linux \u548c\u5176\u4ed6\u7cfb\u7edf\u4e0a\u4f60\u53ef\u4ee5\u505a\u5f88\u591a\u5904\u7406\u3002\u5305\u62ec\u5408\u5e76\u3001\u62c6\u5206\u3001\u65cb\u8f6c\u3001\u62c6\u5206\u6210\u5355\u9875\u3001\u52a0\u5bc6\u548c\u89e3\u5bc6\u3001\u6dfb\u52a0\u6c34\u5370\u3001\u538b\u7f29\u548c\u89e3\u538b\u7f29\uff0c\u751a\u81f3\u8fd8\u6709\u4fee\u590d\u3002 pdftk<\/span> \u547d\u4ee4\u80fd\u6267\u884c\u6240\u6709\u751a\u81f3\u66f4\u591a\u64cd\u4f5c\u3002<\/p>\n

\u201cpdftk\u201d \u4ee3\u8868 \u201cPDF \u5de5\u5177\u5305\u201d\uff08PDF tool kit\uff09\uff0c\u8fd9\u4e2a\u547d\u4ee4\u975e\u5e38\u6613\u4e8e\u4f7f\u7528\uff0c\u5e76\u4e14\u53ef\u4ee5\u5f88\u597d\u5730\u64cd\u4f5c PDF\u3002\u4f8b\u5982\uff0c\u8981\u5c06\u72ec\u7acb\u7684\u6587\u4ef6\u5408\u5e76\u6210\u4e00\u4e2a\u6587\u4ef6\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n

$ pdftk pg1.pdf pg2.pdf pg3.pdf pg4.pdf pg5.pdf cat output OneDoc.pdf<\/pre>\n

OneDoc.pdf<\/span> \u5c06\u5305\u542b\u4e0a\u9762\u663e\u793a\u7684\u6240\u6709\u4e94\u4e2a\u6587\u6863\uff0c\u547d\u4ee4\u5c06\u5728\u51e0\u79d2\u949f\u5185\u8fd0\u884c\u5b8c\u6bd5\u3002\u8bf7\u6ce8\u610f\uff0ccat<\/span> \u9009\u9879\u8868\u793a\u5c06\u6587\u4ef6\u8fde\u63a5\u5728\u4e00\u8d77\uff0coutput<\/span> \u9009\u9879\u6307\u5b9a\u65b0\u6587\u4ef6\u7684\u540d\u79f0\u3002<\/p>\n

\u4f60\u8fd8\u53ef\u4ee5\u4ece PDF \u4e2d\u63d0\u53d6\u9009\u5b9a\u9875\u9762\u6765\u521b\u5efa\u5355\u72ec\u7684 PDF \u6587\u4ef6\u3002\u4f8b\u5982\uff0c\u5982\u679c\u8981\u521b\u5efa\u4ec5\u5305\u542b\u4e0a\u9762\u521b\u5efa\u7684\u6587\u6863\u7684\u7b2c 1\u30012\u30013 \u548c 5 \u9875\u7684\u65b0 PDF\uff0c\u90a3\u4e48\u53ef\u4ee5\u6267\u884c\u4ee5\u4e0b\u64cd\u4f5c\uff1a<\/p>\n

$ pdftk OneDoc.pdf cat 1-3 5 output 4pgs.pdf<\/pre>\n

\u53e6\u5916\uff0c\u5982\u679c\u4f60\u60f3\u8981\u7b2c 1\u30013\u30014 \u548c 5 \u9875\uff08\u603b\u8ba1 5 \u9875\uff09\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n

$ pdftk OneDoc.pdf cat 1 3-end output 4pgs.pdf<\/pre>\n

\u4f60\u53ef\u4ee5\u9009\u62e9\u5355\u72ec\u9875\u9762\u6216\u8005\u9875\u9762\u8303\u56f4\uff0c\u5982\u4e0a\u4f8b\u6240\u793a\u3002<\/p>\n

\u4e0b\u4e00\u4e2a\u547d\u4ee4\u5c06\u4ece\u4e00\u4e2a\u5305\u542b\u5947\u6570\u9875\uff081\u30013 \u7b49\uff09\u7684\u6587\u4ef6\u548c\u4e00\u4e2a\u5305\u542b\u5076\u6570\u9875\uff082\u30014 \u7b49\uff09\u7684\u6587\u4ef6\u521b\u5efa\u4e00\u4e2a\u6574\u5408\u6587\u6863\uff1a<\/p>\n

$ pdftk A=odd.pdf B=even.pdf shuffle A B output collated.pdf<\/pre>\n

\u8bf7\u6ce8\u610f\uff0cshuffle<\/span> \u9009\u9879\u4f7f\u5f97\u80fd\u591f\u5b8c\u6210\u6574\u5408\uff0c\u5e76\u6307\u793a\u6587\u6863\u7684\u4f7f\u7528\u987a\u5e8f\u3002\u53e6\u8bf7\u6ce8\u610f\uff1a\u867d\u7136\u4e0a\u9762\u5efa\u8bae\u7528\u7684\u662f\u5947\u6570\/\u5076\u6570\u9875\uff0c\u4f46\u4f60\u4e0d\u9650\u4e8e\u4ec5\u4f7f\u7528\u4e24\u4e2a\u6587\u4ef6\u3002<\/p>\n

\u5982\u679c\u8981\u521b\u5efa\u53ea\u80fd\u7531\u77e5\u9053\u5bc6\u7801\u7684\u6536\u4ef6\u4eba\u6253\u5f00\u7684\u52a0\u5bc6 PDF\uff0c\u53ef\u4ee5\u4f7f\u7528\u5982\u4e0b\u547d\u4ee4\uff1a<\/p>\n

$ pdftk prep.pdf output report.pdf user_pw AsK4n0thingGeTn0thing<\/pre>\n

\u9009\u9879\u63d0\u4f9b 40\uff08encrypt_40bit<\/span>\uff09\u548c 128\uff08encrypt_128bit<\/span>\uff09\u4f4d\u52a0\u5bc6\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u4f7f\u7528 128 \u4f4d\u52a0\u5bc6\u3002<\/p>\n

\u4f60\u8fd8\u53ef\u4ee5\u4f7f\u7528 burst<\/span> \u9009\u9879\u5c06 PDF \u6587\u4ef6\u5206\u6210\u5355\u4e2a\u9875\u9762\uff1a<\/p>\n

\r\n$ pdftk allpgs.pdf burst\r\n$ ls -ltr *.pdf | tail -5\r\n-rw-rw-r-- 1 shs shs   22933 Aug  8 08:18 pg_0001.pdf\r\n-rw-rw-r-- 1 shs shs   23773 Aug  8 08:18 pg_0002.pdf\r\n-rw-rw-r-- 1 shs shs   23260 Aug  8 08:18 pg_0003.pdf\r\n-rw-rw-r-- 1 shs shs   23435 Aug  8 08:18 pg_0004.pdf\r\n-rw-rw-r-- 1 shs shs   23136 Aug  8 08:18 pg_0005.pdf<\/pre>\n

pdftk<\/span> \u547d\u4ee4\u4f7f\u5f97\u5408\u5e76\u3001\u62c6\u5206\u3001\u91cd\u5efa\u3001\u52a0\u5bc6 PDF \u6587\u4ef6\u975e\u5e38\u5bb9\u6613\u3002\u8981\u4e86\u89e3\u66f4\u591a\u9009\u9879\uff0c\u8bf7\u67e5\u770b PDF \u5b9e\u9a8c\u5ba4\u4e2d\u7684\u793a\u4f8b\u9875\u9762\u3002<\/p>\n


\n

via: https:\/\/www.networkworld.com\/article\/3430781\/how-to-manipulate-pdfs-on-linux.html<\/p>\n

\u4f5c\u8005\uff1aSandra Henry-Stocker \u9009\u9898\uff1alujun9972 \u8bd1\u8005\uff1ageekpi \u6821\u5bf9\uff1awxy<\/p>\n

\u672c\u6587\u7531 LCTT \u539f\u521b\u7f16\u8bd1\uff0cLinux\u4e2d\u56fd \u8363\u8a89\u63a8\u51fa<\/p>\n","protected":false},"excerpt":{"rendered":"

\u867d\u7136 PDF \u901a\u5e38\u88ab\u8ba4\u4e3a\u662f\u76f8\u5f53\u7a33\u5b9a\u7684\u6587\u4ef6\uff0c\u4f46\u5728 Linux \u548c\u5176\u4ed6\u7cfb\u7edf\u4e0a\u4f60\u53ef\u4ee5\u505a\u5f88\u591a\u5904\u7406\u3002\u5305\u62ec\u5408\u5e76\u3001\u62c6\u5206\u3001\u65cb\u8f6c […]<\/p>\n","protected":false},"author":1920,"featured_media":156971,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-156970","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/156970","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/1920"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=156970"}],"version-history":[{"count":4,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/156970\/revisions"}],"predecessor-version":[{"id":157853,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/156970\/revisions\/157853"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/156971"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=156970"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=156970"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=156970"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}