PDFtk Examples

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

Collate scanned pages

pdftk A=even.pdf B=odd.pdf shuffle A B output collated.pdf

or if odd.pdf is in reverse order:

pdftk A=even.pdf B=odd.pdf shuffle A Bend-1 output collated.pdf

Decrypt a PDF

pdftk secured.pdf input_pw foopass output unsecured.pdf

Encrypt a PDF using 128-bit strength (the default), withhold all permissions (the default)

pdftk 1.pdf output 1.128.pdf owner_pw foopass

Same as above, except password baz must also be used to open output PDF

pdftk 1.pdf output 1.128.pdf owner_pw foo user_pw baz

Same as above, except printing is allowed (once the PDF is open)

pdftk 1.pdf output 1.128.pdf owner_pw foo user_pw baz allow printing

Join in1.pdf and in2.pdf into a new PDF, out1.pdf

pdftk in1.pdf in2.pdf cat output out1.pdf

or (using handles):

pdftk A=in1.pdf B=in2.pdf cat A B output out1.pdf

or (using wildcards):

pdftk *.pdf cat output combined.pdf

Remove page 13 from in1.pdf to create out1.pdf

pdftk in.pdf cat 1-12 14-end output out1.pdf

or:

pdftk A=in1.pdf cat A1-12 A14-end output out1.pdf

Apply 40-bit encryption to output, revoking all permissions (the default). Set the owner PW to foopass.

pdftk 1.pdf 2.pdf cat output 3.pdf encrypt_40bit owner_pw foopass

Join two files, one of which requires the password foopass. The output is not encrypted.

pdftk A=secured.pdf 2.pdf input_pw A=foopass cat output 3.pdf

Uncompress PDF page streams for editing the PDF in a text editor (e.g., vim, emacs)

pdftk doc.pdf output doc.unc.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 pages and dump its data to doc_data.txt

pdftk in.pdf burst

Burst a single PDF document into encrypted pages. Allow low-quality printing

pdftk in.pdf burst owner_pw foopass allow DegradedPrinting

Write a report on PDF document metadata and bookmarks to report.txt

pdftk in.pdf dump_data output report.txt

Rotate the first PDF page to 90 degrees clockwise

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

Rotate an entire PDF document to 180 degrees

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

Article Author: Sid Steward

时间: 2024-10-05 09:26:18

PDFtk Examples的相关文章

Bg, Fg, &, Ctrl-Z – 5 Examples to Manage Unix Background Jobs

When you execute a unix shell-script or command that takes a long time, you can run it as a background job. In this article, let us review how to execute a job in the background, bring a job to the foreground, view all background jobs, and kill a bac

强大的pdf文件操作小工具——PDFtk的小白用法

前言 作为程序员,大家都知道的,总是会被技术小白问各种跟编程没什么关系的硬件.软件问题.曾经被一技术小白同事问到有没有什么办法合并pdf文件,当时自己也是一头雾水,因为自己工作生活很少会去操作pdf文件,而当时公司对开发人员的电脑权限管理很严格,不论是上网还是安装软件,都受到很大限制,最后硬着头皮忙活了一阵子也没在解决. 前两天在写批处理程序的时候,发现批处理程序是有合并文件的命令的,我忽然想起之前这个同事的问题,就试了一下合并pdf,然而并不行.虽然失落了一下,但本着学习的精神还是百度了一下关

Can you share some Scala List class examples?

Scala List FAQ: Can you share some Scala List class examples? The Scala List class may be the most commonly used data structure in Scala applications. Therefore, it's very helpful to know how create lists, merge lists, select items from lists, operat

First class ,6 examples anlaysisi

http://www.fgm.cc/learn/ First class ,6 examples anlaysisi          

Useful Qt Examples

Canvas API Basic Layouts Camera Example Video Widget Example Image Viewer Example Part 6 - Loading and Saving Show in Finder / Show in Explorer Item Views Examples http://www.cnblogs.com/grandyang/p/4278324.html http://www.cnblogs.com/grandyang/p/427

OpenERP-Java调用XML-RPC接口示例(Examples for calling XML-RPC interfaces by Java)

官网没有给出CREATE.SEARCH.WRITE等XML-RPC接口的Java 调用示例,在此补充一下. There is no examples on the official site for the XML-RPC operation interfaces for Java, so I posted my code here. /**  * Created by kylin on 14-9-22.  */ import org.apache.xmlrpc.XmlRpcException;

Qt5官方demo解析集33——Qt Quick Examples - Window and Screen

本系列所有文章可以在这里查看http://blog.csdn.net/cloud_castle/article/category/2123873 接上文Qt5官方demo解析集32--Qt Quick Examples - Threading 来到我们Qt Quick Examples的第二个例子了,之所以挑这个demo,主要是我们使用Qt开发界面(尤其是跨平台界面)时,本地屏幕信息与窗口调用是不可避免的课题. 这个例子便向我们展示了在QML中获取本地屏幕信息的方法. 项目树如图,其中share

DataBinding examples

Databinding in Windows Forms demo (CSWinFormDataBinding) /************************************* Module Header *************************************** Module Name: MainForm.cs * Project: CSWinFormDataBinding * Copyright (c) Microsoft Corporation. * *

AWS s3 python sdk code examples

Yet another easy-to-understand, easy-to-use aws s3 python sdk code examples. github地址:https://github.com/garyelephant/aws-s3-python-sdk-examples. """ Yet another s3 python sdk example. based on boto 2.27.0 """ import time imp