命令行处理pdf的利器:PDFTK.exe

http://www.pdflabs.com/docs/pdftk-cli-examples/

Pdftk Examples

These examples show you how to perform common PDF tasks from the command-line using pdftk.

Merge Two or More PDFs into a New Document

pdftk 1.pdf 2.pdf 3.pdf cat output 123.pdf

or (Using Handles):

pdftk A=1.pdf B=2.pdf cat A B output 12.pdf

or (Using Wildcards):

pdftk *.pdf cat output combined.pdf

Split Select Pages from Multiple PDFs into a New Document

pdftk A=one.pdf B=two.pdf cat A1-7 B1-5 A8 output combined.pdf

Rotate the First Page of a PDF to 90 Degrees Clockwise

pdftk in.pdf cat 1E 2-end output out.pdf

Rotate an Entire PDF Document’s Pages to 180 Degrees

pdftk in.pdf cat 1-endS output out.pdf

Encrypt a PDF using 128-Bit Strength (the Default) and Withhold All Permissions (the Default)

pdftk mydoc.pdf output mydoc.128.pdf owner_pw foopass

Same as Above, Except a Password is Required to Open the PDF

pdftk mydoc.pdf output mydoc.128.pdf owner_pw foo user_pw baz

Same as Above, Except Printing is Allowed (after the PDF is Open)

pdftk mydoc.pdf output mydoc.128.pdf owner_pw foo user_pw baz allow printing

Decrypt a PDF

pdftk secured.pdf input_pw foopass output unsecured.pdf

Join Two Files, One of Which is Encrypted (the Output is Not Encrypted)

pdftk A=secured.pdf mydoc.pdf input_pw A=foopass cat output combined.pdf

Uncompress PDF Page Streams for Editing the PDF Code in a Text Editor

pdftk mydoc.pdf output mydoc.clear.pdf uncompress

Repair a PDF’s Corrupted XREF Table and Stream Lengths (If Possible)

pdftk broken.pdf output fixed.pdf

Burst a Single PDF Document into Single Pages and Report its Data to doc_data.txt

pdftk mydoc.pdf burst

Report on PDF Document Metadata, Bookmarks and Page Labels

pdftk mydoc.pdf dump_data output report.txt

Article Author: Sid Steward

Notes

Pdftk is a command-line program, so you should use your computer terminal or command prompt when first testing these examples.

Related Articles
Article Tags

转载于:https://www.cnblogs.com/seapub/archive/2012/09/06/2672929.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值