PDFTK(1)							      PDFTK(1)



NAME
       pdftk - A handy tool for manipulating PDF

SYNOPSIS
       pdftk <input PDF files>
	     [input_pw <input PDF owner passwords>]
	     [<operation> <operation arguments>]
	     [output <output filename>]
	     [encrypt_40bit | encrypt_128bit] [allow <permissions>]
	     [owner_pw <owner password>] [user_pw <user password>]
	     [compress | uncompress]
	     [verbose]

DESCRIPTION
       If PDF is electronic paper, then pdftk is an electronic staple-remover,
       hole-punch, binder, secret-decoder-ring, and X-Ray-glasses.  Pdftk is a
       simple tool for doing everyday things with PDF documents.  Use it to:

       * Merge PDF Documents
       * Split PDF Pages into a New Document
       * Decrypt Input as Necessary (Password Required)
       * Encrypt Output as Desired
       * Burst a PDF Document into Single Pages
       * Report on PDF Metrics, including Metadata and Bookmarks
       * Uncompress and Re-Compress Page Streams
       * Repair Corrupted PDF (Where Possible)

OPTIONS
       A summary of options is included below.

       --help, -h
	      Show summary of options.

       <input PDF files>
	      A list of the input PDF files. If you plan to combine these PDFs
	      (without using handles) then list files in the  order  you  want
	      them  combined.	Input  files  can  be associated with handles,
	      where a handle is a single, upper-case letter:

	      <input PDF handle>=<input PDF filename>

	      Handles are often omitted.  They are useful when specifying  PDF
	      passwords or page ranges, later.

	      For example: A=input1.pdf B=input2.pdf

       [input_pw <input PDF owner passwords>]
	      Input  PDF  owner  passwords,  if necessary, are associated with
	      files by using their handles:

	      <input PDF handle>=<input PDF file owner password>

	      If handles are not given, then  passwords  are  associated  with
	      input files by order.

	      Most  pdftk features require that encrypted input PDF are accom-
	      panied by the ~owner~ password. If the input PDF	has  no  owner
	      password, then the user password must be given, instead.	If the
	      input PDF has no passwords, then no password should be given.

       [<operation> <operation arguments>]
	      If this optional argument is omitted, then pdftk runs  in  'fil-
	      ter'  mode.   Filter mode takes only one PDF input and creates a
	      new PDF after applying all of the output arguments, like encryp-
	      tion and compression.

	      Available  operations  are:  cat, burst, and dump_data. Only cat
	      takes additional arguments in the form of page ranges, described
	      below.

	      cat    Catenates	pages  from  input  PDFs  to create a new PDF.
		     Page order in the new PDF is specified by	the  order  of
		     the  given  page  ranges.	Page ranges are described like
		     this:

		     <input PDF handle>[<begin page  number>[-<end  page  num-
		     ber>[<qualifier>]]]

		     Where  the  handle identifies one of the input PDF files,
		     and the beginning and ending page numbers	are  one-based
		     references  to  pages  in the PDF file, and the qualifier
		     can be even or odd.

		     If the handle is omitted, then the pages are  taken  from
		     the first input PDF.

		     If  no  arguments	are passed to cat, then pdftk combines
		     all input PDFs in the order they were given to create the
		     output.

		     NOTES:
		     * The end page number may be less than begin page number.
		     * The keyword end may be used to reference the final page
		     of a document instead of a page number.
		     *	Reference  a  single  page by omitting the ending page
		     number.
		     *	The  handle  may be used alone to represent the entire
		     PDF document, i.e., B1-end is the same as B.

		     Page range examples:
		     A1-21
		     Bend-1odd
		     A72
		     A1-21 Beven A72

	      burst  Splits  a	single,  input	PDF  document  into individual
		     pages.  Do not provide an output section. Encryption  can
		     be   applied   by	 appending   output   arguments,  like
		     encrypt_128bit, e.g.:

		     pdftk in.pdf burst owner_pw foopass encrypt_128bit

	      dump_data
		     Reads a  single,  input  PDF  file  and  reports  various
		     statistics,  metadata,  and  bookmarks  (outlines) to the
		     given output filename or to stdout.  Does	not  create  a
		     new PDF.

       [output <output filename>]
	      The  output  PDF filename may not be set to the name of an input
	      filename.

       [encrypt_40bit | encrypt_128bit]
	      If an output PDF user or owner password  is  given,  output  PDF
	      encryption  strength defaults to 128 bits.  This can be overrid-
	      den by specifying encrypt_40bit.

       [allow <permissions>]
	      Permissions are applied to the output PDF only if an  encryption
	      strength is specified or an owner or user password is given.  If
	      permissions are not specified, they  default  to	'none,'  which
	      means all of the following features are disabled.

	      The permissions section may include one or more of the following
	      features:

	      Printing
		     Top Quality Printing

	      DegradedPrinting
		     Lower Quality Printing

	      ModifyContents

	      Assembly

	      CopyContents

	      ScreenReaders

	      ModifyAnnotations

	      FillIn

	      AllFeatures
		     Allows the user to perform all of the above.

       [owner_pw <owner password>] [user_pw <user password>]
	      If an encryption strength is given but  no  passwords  are  sup-
	      plied,  then  the  owner	and user passwords remain empty, which
	      means that the resulting PDF may	be  opened  and  its  security
	      parameters altered by anybody.

       [compress | uncompress]
	      These  are  only useful when you want to edit PDF code in a text
	      editor like vim or emacs.  Remove PDF page stream compression by
	      applying	the  uncompress  filter.  Use  the  compress filter to
	      restore compression.

       [verbose]
	      By default, pdftk runs quietly. Append verbose to the end and it
	      will speak up.

EXAMPLES
       Decrypt a PDF
	      pdftk secured.pdf input_pw foopass output unsecured.pdf

       Encrypt	a  PDF using 128-bit strength (the default), withhold all per-
       missions (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 out-
       put 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 mydoc.pdf burst

       Burst  a  single  PDF  document into encrypted pages. Allow low-quality
       printing
	      pdftk mydoc.pdf burst owner_pw foopass allow DegradedPrinting

       Write a report on PDF document metadata and bookmarks to report.txt
	      pdftk mydoc.pdf dump_data output report.txt

AUTHOR
       pdftk was written by Sid Steward <ssteward@accespdf.com>.



			       February 15, 2004		      PDFTK(1)
