Logo The PDF Toolkit

If you like pdftk, then you'll appreciate the other 25 programs and scripts I created for my book, PDF Hacks. Read some sample hacks, the Table of Contents or the Index. See an online example or two, and then buy the book. Thanks!  –Sid

PDF Hacks by Sid Steward; O'Reilly Media

Pdftk uses the iText library. Here's a new book about programming with iText, written by the iText author himself!

iText In Action by Bruno Lowagie

(While iText is a Java library, pdftk is not Java — thanks to the magic of GCJ!)



Latest Version: 1.41, Released: November 28, 2006

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. Keep one in the top drawer of your desktop and use it to:

  • Merge PDF Documents

  • Split PDF Pages into a New Document

  • Rotate PDF Pages or Documents

  • Decrypt Input as Necessary (Password Required)

  • Encrypt Output as Desired

  • Fill PDF Forms with FDF Data or XFDF Data and/or Flatten Forms

  • Apply a Background Watermark or a Foreground Stamp

  • Report on PDF Metrics such as Metadata, Bookmarks, and Page Labels

  • Update PDF Metadata

  • Attach Files to PDF Pages or the PDF Document

  • Unpack PDF Attachments

  • Burst a PDF Document into Single Pages

  • Uncompress and Re-Compress Page Streams

  • Repair Corrupted PDF (Where Possible)

Pdftk allows you to manipulate PDF easily and freely. It does not require Acrobat, and it runs on Windows, Linux, Mac OS X, FreeBSD and Solaris.

   

Examples

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

Docs

SYNOPSIS
       pdftk <input PDF files | - | PROMPT>
	    [input_pw <input PDF owner passwords | PROMPT>]
	    [<operation> <operation arguments>]
	    [output <output filename | - | PROMPT>]
	    [encrypt_40bit | encrypt_128bit]
	    [allow <permissions>]
	    [owner_pw <owner password | PROMPT>]
	    [user_pw <user password | PROMPT>]
	    [flatten] [compress | uncompress]
	    [keep_first_id | keep_final_id] [drop_xfa]
	    [verbose] [dont_ask | do_ask]
       Where:
	    <operation> may be empty, or:
	    [cat | attach_files | unpack_files | burst |
	     fill_form | background | stamp | generate_fdf
	     dump_data | dump_data_fields | update_info]

       For Complete Help: pdftk --help

OPTIONS
       A summary of options is included below.

       --help, -h
	      Show summary of options.

       <input PDF files | - | PROMPT>
	      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.  Use - to pass a single PDF into pdftk via stdin.
	      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 | PROMPT>]
	      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.

	      When  running  in do_ask mode, pdftk will prompt you for a pass-
	      word if the supplied password is incorrect or none was 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 options,  like  encryp-
	      tion and compression.

	      Available   operations  are:  cat,  attach_files,  unpack_files,
	      burst,	 fill_form,	background,	stamp,	    dump_data,
	      dump_data_fields,  generate_fdf,	update_info.  Some  operations
	      takes additional arguments, described below.

	  cat [<page ranges>]
		 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>]]][<page rotation>]

		 Where	the  handle identifies one of the input PDF files, and
		 the beginning and ending page numbers	are  one-based	refer-
		 ences to pages in the PDF file, and the qualifier can be even
		 or odd, and the page rotation can be N, S, E, W, L, R, or  D.

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

		 The even qualifier causes pdftk to use only the even-numbered
		 PDF  pages, so 1-6even yields pages 2, 4 and 6 in that order.
		 6-1even yields pages 6, 4 and 2 in that order.

		 The odd qualifier works similarly to the even.

		 The page rotation setting can cause pdftk to rotate pages and
		 documents.  Each option sets the page rotation as follows (in
		 degrees): N: 0, E: 90, S: 180, W: 270, L:  -90,  R:  +90,  D:
		 +180. L, R, and D make relative adjustments to a page's rota-
		 tion.

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

		 NOTES:
		 * <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, e.g., B1-end is the same as B.

		 Page Range Examples w/o Handles:
		 1-endE - rotate entire document 90 degrees
		 5 11 20
		 5-25oddW - take odd pages in range, rotate 90 degrees
		 6-1

		 Page Range Examples Using Handles:
		 Say A=in1.pdf B=in2.pdf, then:
		 A1-21
		 Bend-1odd
		 A72
		 A1-21 Beven A72
		 AW - rotate entire document 90 degrees
		 B
		 A2-30evenL  -	take  the even pages from the range, remove 90
		 degrees from each page's rotation
		 A A
		 AevenW AoddE
		 AW BW BD

	  attach_files <attachment filenames | PROMPT> [to_page <page number |
	  PROMPT>]
		 Packs arbitrary files into a PDF using PDF's file  attachment
		 features.  More  than	one  attachment  may  be  listed after
		 attach_files. Attachments are added  at  the  document  level
		 unless  the  optional	to_page option is given, in which case
		 the files are attached to the given page  number  (the  first
		 page is 1, the final page is end). For example:

		 pdftk	in.pdf	attach_files table1.html table2.html to_page 6
		 output out.pdf

	  unpack_files
		 Copies all of the attachments from the  input	PDF  into  the
		 current  folder or to an output directory given after output.
		 For example:

		 pdftk report.pdf unpack_files output ~/atts/

		 or, interactively:

		 pdftk report.pdf unpack_files output PROMPT

	  burst  Splits a single, input PDF document  into  individual	pages.
		 Also creates a report named doc_data.txt which is the same as
		 the output from dump_data.  If the output section is omitted,
		 then  PDF  pages  are	named: pg_%04d.pdf, e.g.: pg_0001.pdf,
		 pg_0002.pdf, etc.  To name these  pages  yourself,  supply  a
		 printf-styled	format	string	via  the  output section.  For
		 example, if you want pages named:  page_01.pdf,  page_02.pdf,
		 etc.,	pass output page_%02d.pdf to pdftk.  Encryption can be
		 applied to the output by appending  output  options  such  as
		 owner_pw, e.g.:

		 pdftk in.pdf burst owner_pw foopass

	  fill_form <FDF data filename | XFDF data filename | - | PROMPT>
		 Fills	the  single input PDF's form fields with the data from
		 an FDF file, XFDF file or  stdin.  Enter  the	data  filename
		 after	fill_form,  or	use - to pass the data via stdin, like
		 so:

		 pdftk form.pdf fill_form data.fdf output form.filled.pdf

		 After filling a form,	the  form  fields  remain  interactive
		 unless you also use the flatten output option. flatten merges
		 the form fields with the  PDF	pages.	You  can  use  flatten
		 alone, too, but only on a single PDF:

		 pdftk form.pdf fill_form data.fdf output out.pdf flatten

		 or:

		 pdftk form.filled.pdf output out.pdf flatten

		 If  the  input  FDF file includes Rich Text formatted data in
		 addition to plain text, then the Rich	Text  data  is	packed
		 into  the  form fields as well as the plain text.  Pdftk also
		 sets a flag that cues Acrobat/Reader to  generate  new  field
		 appearances  based on the Rich Text data.  That way, when the
		 user opens the PDF, the viewer  will  create  the  Rich  Text
		 fields  on  the spot.	If the user's PDF viewer does not sup-
		 port Rich Text, then the user will see the  plain  text  data
		 instead.   If	you  flatten  this  form  before Acrobat has a
		 chance to create (and save) new field appearances,  then  the
		 plain text field data is what you'll see.

	  background <background PDF filename | - | PROMPT>
		 Applies  a  PDF watermark to the background of a single input
		 PDF.  Pass the background  PDF's  filename  after  background
		 like so:

		 pdftk in.pdf background back.pdf output out.pdf

		 Pdftk	uses  only  the first page from the background PDF and
		 applies it to every page of the  input  PDF.	This  page  is
		 scaled  and rotated as needed to fit the input page.  You can
		 use - to pass a background PDF into pdftk via stdin.

		 If the input PDF does not have a transparent background (such
		 as  a	PDF  created from page scans) then the resulting back-
		 ground won't be visible -- use the stamp feature instead.

	  stamp <stamp PDF filename | - | PROMPT>
		 This behaves just like the background feature except it over-
		 lays  the  stamp  PDF page on top of the input PDF document's
		 pages.  This works best if the stamp PDF page has a transpar-
		 ent background.

	  dump_data
		 Reads	a  single,  input PDF file and reports various statis-
		 tics, metadata, bookmarks (a/k/a outlines), and  page	labels
		 to  the  given  output filename or (if no output is given) to
		 stdout.  Does not create a new PDF.

	  dump_data_fields
		 Reads a single, input PDF file and reports form field statis-
		 tics  to the given output filename or (if no output is given)
		 to stdout.  Does not create a new PDF.

	  generate_fdf
		 Reads a single, input PDF file and generates a FDF file suit-
		 able  for fill_form out of it to the given output filename or
		 (if no output is given) to stdout.  Does  not	create	a  new
		 PDF.

	  update_info <info data filename | - | PROMPT>
		 Changes the metadata stored in a single PDF's Info dictionary
		 to match the input data file. The input data  file  uses  the
		 same  syntax  as  the	output	from  dump_data. This does not
		 change the metadata stored in the PDF's XMP stream, if it has
		 one. For example:

		 pdftk in.pdf update_info in.info output out.pdf

       [output <output filename | - | PROMPT>]
	      The  output  PDF filename may not be set to the name of an input
	      filename. Use - to output to stdout.  When using	the  dump_data
	      operation,  use  output to set the name of the output data file.
	      When using the unpack_files operation, use  output  to  set  the
	      name  of	an  output directory.  When using the burst operation,
	      you can use output to control the resulting PDF  page  filenames
	      (described above).

       [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
		     Also allows Assembly

	      Assembly

	      CopyContents
		     Also allows ScreenReaders

	      ScreenReaders

	      ModifyAnnotations
		     Also allows FillIn

	      FillIn

	      AllFeatures
		     Allows  the  user	to  perform  all of the above, and top
		     quality printing.

       [owner_pw <owner password | PROMPT>]

       [user_pw <user password | PROMPT>]
	      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.

       [flatten]
	      Use this option to merge an input PDF's interactive form	fields
	      (and their data) with the PDF's pages. Only one input PDF may be
	      given. Sometimes used with the fill_form operation.

       [keep_first_id | keep_final_id]
	      When combining pages  from  multiple  PDFs,  use	one  of  these
	      options  to  copy the document ID from either the first or final
	      input document into the new output PDF. Otherwise pdftk  creates
	      a  new  document	ID  for  the  output PDF. When no operation is
	      given, pdftk always uses the ID from the (single) input PDF.

       [drop_xfa]
	      If your input PDF is a form created using  Acrobat  7  or  Adobe
	      Designer,  then  it  probably has XFA data.  Filling such a form
	      using pdftk yields a PDF with data  that	fails  to  display  in
	      Acrobat  7  (and	6?).  The workaround solution is to remove the
	      form's XFA data, either before you fill the form using pdftk  or
	      at the time you fill the form. Using this option causes pdftk to
	      omit the XFA data from the output PDF form.

	      This option is only needed when running pdftk on a single  input
	      PDF.   When  assembling  a PDF from multiple inputs using pdftk,
	      any XFA data in the input is automatically omitted.

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

       [dont_ask | do_ask]
	      Depending on the compile-time settings (see ASK_ABOUT_WARNINGS),
	      pdftk might prompt you for further input when  it  encounters  a
	      problem,	such as a bad password. Override this default behavior
	      by adding dont_ask (so pdftk won't ask you what to do) or do_ask
	      (so pdftk will ask you what to do).

	      When  running in dont_ask mode, pdftk will over-write files with
	      its output without notice.

Program Downloads and Packages

Pdftk runs on a variety of platforms, including: Windows, Linux, Mac OS X, FreeBSD, and Solaris. Installation packages are available for some of these platforms. If a package is not available for your platform, then download the source code and build pdftk as described later. Note that some of these packages might not provide the latest version of pdftk (1.41). Check the version history to see how well an older version of pdftk might suit your needs.

Windows Program Download

Download and unzip the following file. Move the resulting pdftk.exe to a convenient location, such as C:\windows\system32. Open a command prompt and type pdftk --help. You should get the above documentation.

Debian Packages

Pdftk 1.12 is now part of Sarge (stable). More recent versions are available for Etch (testing) and Sid (unstable). Thanks to Aurélien Jarno for debianizing pdftk, and thanks to Aurélien GÉRÔME for now maintaining the debian package!

Ubuntu Packages

Ubuntu users also have pdftk packages.

Macintosh OS X Panther Installer

Scott E. Lasley has kindly provided this pdftk 1.12 installer package for OS X 10.3 users. OS X 10.2 users must build pdftk as described below.

David Rendon informed me of a Mac alternative to pdftk called Combine PDFs.

SuSE 10 RPM Package Download

Olé! SuSE provides pdftk with their latest versions.

SuSE 9.2 RPM Package Download

Bernhard Walle has kindly provided binary and source RPMs for pdftk 1.12.

SuSE 9.0 RPM Package Download

Tristan Miller has kindly provided a binary RPM for pdftk 1.00. He says it should also work for SuSE 8.2 users and other i386-compatible GNU/Linux systems.

SuSE 8.2 RPM Package Downloads

Friedrich Lobenstock has kindly provided binary and source RPMs for SuSE 8.2 users.

Gentoo Package

Thanks to Mamoru KOMACHI for creating and maintaining this package.

FreeBSD Port

Thanks to Patrick Dung for porting pdftk to FreeBSD.

Vim

Vim users can also install my plug-in for easily editing PDF code. When you open a PDF in Vim, the plug-in calls pdftk to uncompress the page streams, so they are editable. When you save the PDF, the plug-in uses pdftk to repair and re-compress the PDF.

Download pdftk.vim.zip, unpack, and then move pdftk.vim into your Vim plug-ins directory (e.g., C:\vim\vim63\plugin). Restart Vim to source the new plug-in.

KDE

Konqueror users will appreciate the service menus provided by Mikolaj Machowski. Download pdftk.desktop and install it according to this tutorial. Right-click a PDF in Konqueror and you will find these pdftk-powered options in your context menu: burst, merge, encrypt, decrypt, info. Service menus are plain text files that are easy to customize.

PHP

PHP programmers can use my forge_fdf program to easily cast data into FDF. Pdftk can then merge a PDF form with this FDF data to yield a static PDF. See pdftk's fill_form operation to learn more about merging PDF with FDF. To discover PDF form names, use pdftk's dump_data_fields operation.

Visit www.pdfhacks.com/forge_fdf/ to download the latest versin of forge_fdf.

Source Download and Build Instructions

I built pdftk 1.41 using gcc/gcj/libgcj versions 3.4.2. Pdftk 1.4x fails to build on gcc 3.3.5 due to missing libgcj features. If you have gcc 3.3, try building pdftk 1.12 instead. Gcc 3.2 folks might have some luck with the older pdftk versions, too. Please let me know what luck you have compiling pdftk with older versions of gcc.

Different Linux distributions package libgcj differently; here are some examples (please e-mail me with updates and additions): Debian: libgcj5-dev, SuSE: libgcj-devel, Slackware: gcc-java (I believe).

Windows Build Notes

I build pdftk on my Windows system using MinGW and MSYS, gcc version 3.4.2.

Mac OS X Build Notes

Mac OS X users must first build and/or install GCJ. John M. Gabriele has confirmed that pdftk builds and runs on OS X. You will need to edit Makefile.MacOSX and change TOOLPATH to reflect the location of your GCJ toolset. Brian D. Foy shares your frustration at having to build GCJ. Please e-mail me with any links to GCJ installers for OS X.

Peter Hartmann reports:

The process of installing gcj is painless if you use darwinports (http://www.darwinports.com and http://gcj34.darwinports.com/).

With darwinports (v. 1.2) installed, issue the command

sudo port install gcj34

and wait for hours for the compile to complete.

Since darwinports by default installs in /opt/local, the TOOLPATH in the Makefile.MacOSX for pdftk has to be set as

TOOLPATH= /opt/local/gcj34-3.4.5/bin/

Now cd to the pdftk directory inside the unpacked distribution directory (pdftk-1.41), compile and install:

make -f Makefile.MacOSX
sudo make -f Makefile.MacOSX install

Be sure to add /usr/local/bin to the PATH in your shell environment, if not included already.

Thanks, Peter!

Maarten Sneep reports:

The HPC compiler collection at http://hpc.sourceforge.net includes gcj (in addition to all the other compilers in gcc). The binary package unpacks with tar, and installs in /usr/local

I've compiled pdftk with it, and it seems fine (encryption works). It's "just" a 187 MB download (at least you don't have to comple the compiler yourself ;-) . I changed TOOLPATH to /usr/local/bin/, because that is where gcj lives with this install. Most terminal users will already have this in their path, I guess (it isn't by default though on Mac OS X).

Thanks, Maarten!

Source RPM Download for SuSE and Other RPM-Based Linux Distributions

Bernhard Walle has kindly provided a source RPM for pdftk 1.12.

From his download page: "... the SRPMs work for every RPM-based distribution. That is RedHat/Fedora, Mandrake, SuSE and some others. Just use rpmbuild --rebuild ....src.rpm to get a RPM for your Linux installation."

SuSE 8.2 Build Notes

Stefan Armbruster notes: "The gcj version shipping with Suse 8.2 (it's gcc 3.3) seems to be buggy. After installing the recent gcc 3.4.1, pdftk compiles and runs fine. If you read the follow ups to http://gcc.gnu.org/ml/java/2003-04/msg00266.html, there is a reference to a gcj patch. This seems to be applied if 3.4.1."

Download and Build pdftk

  • Download and unpack: pdftk-1.41.tar.gz (~0.9MB), or: pdftk-1.41.tar.bz2 (~0.7MB)

  • Review the Makefile provided for your platform and confim that TOOLPATH and VERSUFF suit your installation of gcc/gcj/libgcj. If you run apropos gcc and it returns something such as gcc-3.3, then set VERSUFF to -3.3. The TOOLPATH needs to be set only if you have compiled gcc/gcj yourself and installed it in a location that isn't in your PATH (you know who you are).

  • Change into the pdftk sub-directory,

  • Debian systems: run make -f Makefile.Debian

  • RedHat systems: run make -f Makefile.RedHat

  • Mandrake systems: run make -f Makefile.Mandrake

  • Mac OS X systems: run make -f Makefile.MacOSX

  • Solaris systems: run make -f Makefile.Solaris

  • Windows systems: run make -f Makefile.Windows

  • All Others: run make -f Makefile.Generic

  • Reduce the resulting filesize with strip, e.g.: strip pdftk.exe

Bug Reporting and Feature Requests

Please contact me with any bug reports or comments. Thanks!

Related Pages

Version History

  • 1.41 - November 28, 2006

    • Fixed a bug that corrupted output PDF xref tables. This corruption was mild but universal. Most PDF tools can cope with the corrupted PDFs, but I recommend upgrading from 1.40 to 1.41 as soon as possible. This bug was introduced in version 1.40 — version 1.12 does not have this bug.

    • Fixed a bug that prevented XFDF form data from being passed to pdftk via stdin.

    • Commented out some unused code from pdftk.cc.

  • 1.40 - September 19, 2006

    • Added the stamp operation, a natural complement to the existing background operation.

    • Added the page rotating patch provided by David Fabel &mdash thanks! Tweaked the patch so it handles a greater variety of input syntax (e.g., 1-20evenE).

    • Added the generate_fdf patch provided Bernhard R. Link &mdash thanks! I actually rewrote the patch so it uses FDF features built into the iText library. Please let me know my changes break anything downstream.

    • The fill_form operation can now take XFDF data as well as FDF data. This feature was sponsored by Vesaria — thanks!

    • Added the drop_xfa option so pdftk could fill forms created with newer versions of Acrobat or Adobe Designer. Read more about this above.

    • Added the keep_first_id and keep_final_id options for more PDF fun.

    • Upgraded the iText library we use to itext-paulo rev. 155. This makes pdftk harder to compile on older versions of gcc.

    • Added the -O2 optimizing switch to Makefile GCJFLAGS. This should make pdftk leaner and meaner, but could be dropped if your build acts funny (like segfaulting).

    • Fixed a bug that caused pdftk to create bloated PDFs when input PDF pages had links on their pages.

    • Added License-Adobe.txt to the fonts folder, as required for distribution of Adobe's AFM files.

  • 1.12 - November 9, 2004 - [old source code] - [old windows exe]

    • Fixed a bug where the presense of page annotations in some PDFs would cause pdftk to crash. This bug first emerged when processing a PDF created by FPDF (version 1.52) that contained web links. Turns out that pdftk erroneously expected all page annotations to be indirect objects. This assumption has been removed from the code.

  • 1.11 - November 3, 2004 - [old source code] - [old windows exe]

    • Fixed a couple bugs in the dump_data_fields form field reporting. Also improved this feature so it now reports all possible settings for check box, radio button, list box and combo box form fields.

  • 1.10 - October 27, 2004 - [old source code] - [old windows exe]

    • Fixed the background feature so it handles rotated pages (input PDF or background PDF) better. Pdftk will transform the background PDF page so that its orientation is preserved on every page of the output PDF, even on input PDF pages that are rotated. I chose this logic so as to give the user greater control over the results; rotate pages before processing to achieve the desired output. Let me know if this logic is too inconveniet for you.

    • Fixed form field handling when combining PDF pages. Pdftk used to permit duplicate form field names, which is illegal PDF. Now, pdftk detects duplicates and adds name prefixes as needed. If no duplicates occur, then no changes are made. If an input PDF has a field represented by multiple annotations, then that is respected and preserved in the output.

      An especially nice upshot to this new handling is that you can now assemble duplicate PDF forms and not end up with all of their fields echoing each other (as you get with Acrobat). Run pdftk A=form.pdf cat A A A output formX3.pdf and you'll get a form that behaves as you would expect.

    • Added stdin support for input PDF, FDF, or Info files (thanks to Bart Orbons for this patch).

    • Added a means for users to control the output PDF filenames when using the burst feature: pass in a printf-styled format string via output (documented above).

    • Changed background command-line syntax, so it is an operation instead of an output option. The old syntax also works, for backward compatibility.

    • Now shuffling subset font name prefixes for input PDFs, to prevent duplicates.

    • Updated Makefile.Mandrake according to feedback from Larry Gilliland.

    • Reduced the Windows EXE filesize using UPX, as suggested by Ralf Koenig.

  • 1.00 - August 14, 2004 - [old source code] - [old windows exe]

    • Upgraded the iText library we use to itext-paulo rev. 132, which resolved a bug involving bookmark page references in dump_data output.

    • Fixed the problem of form fields getting corrupted by splitting or merging PDF form pages.

    • Building the Windows binary using libgcj 3.4 seems to have fixed the problem of using accented characters in filenames and paths.

    • Added these new operations: fill_form, update_info, attach_file, and unpack_file.

    • Added the background and flatten output options.

    • Added the do_ask interactive mode (the default on Windows) that asks before overwriting files and asks for passwords to input PDFs, if necessary. Also added the dont_ask mode (the default on Linux), for hands-free operation.

    • Many input fields can be substituted with PROMPT, which cues pdftk to ask the user for a filename or password upon execution.

    • Added output to stdout via output -.

    • Using the uncompress option now also adds page numbers to page dictionaries, for easy lookup. Find page N (1-based) by searching for /pdftk_PageNum N. Using the compress option removes these markers.

    • Added Mac OS X Makefile, and removed the optimization flag from the GCJ flags (which would cause trouble on older versions of gcc, such as 3.2.2) in all Makefiles.

    • Now catching PDF output open exceptions.

    • Builds now pack iText font afm files into pdftk, which are required for the new form filling feature.

  • 0.941 - March 28, 2004 - [old source code] - [old windows exe]

    • Fixed the 'Input_UnicodeBig not found' error encountered by Windows users when using the dump_data or the burst operations on some PDFs.

    • Added an optimization flag to the gcj arguments. This can be adjusted or omitted by editing your platform-specific Makefile.

    • Renamed the CC_OPTS Makefile macro to CXXFLAGS, for uniformity.

  • 0.94 - March 24, 2004

    • Fixed a string copy bug in pdftk.cc.

    • Fixed unicode string output so it drops initial, signature character.

    • Fixed nagging gnu.java.locale.Calendar static linking problem (Windows).

    • Made more improvements towards gcc/gcj 3.2 compatibility (e.g., RedHat 8, 9).

    • Added macros to Makefiles, for easier porting.

    • Added simple return codes: 0 --> Success, 1 --> Error, 2 --> Exception. Some exceptions will return an "Error" return code.

    • Removed warning issued when an input PDF has no ID string.

    • Empty Info fields no longer reported on dump_data.

    • Added newline to end of --help output.

  • 0.93 - March 7, 2004

    • Removed restriction on the number of input documents. For example, you can now run:

      pdftk *.pdf cat output combined.pdf

      to assemble any number of PDFs into a single document.

    • Made pdftk run silently by default, and added the verbose output option for when you want detailed feedback.

    • Changed the encryption strength default from 40-bit to 128-bit.

    • Improved file open error handling and reporting. If pdftk can't open a PDF, it tells you why.

    • Added RedHat9 and Mandrake makefiles (Thanks to Andre Gompel and Pablo Rodríguez). Support for these platforms is still experimental.

    • Copied the MD5 code from libgcj into our tree, to improve support for older compilers/libraries. This should improve RedHat9 and Mandrake support.

    • Removed pointless warning sometimes issued by the libgcj security class.

    • Added debian directory and Aurélien's man page, updated man page.

    • Reorganized Makefiles (thanks Andre).

  • 0.92

    • Added logical page numbering (a/k/a page labels) to dump_data operation.

    • Appended .omit extension to a few iText files we don't use, to speed compiling.

  • 0.91

    • Removed restriction on adding the same page from the same PDF more than once.

    • Added Solaris Makefile.

    • AllFeatures permission now implies 'top quality' printing, not 'degraded' printing.

    • Fixed handling of 'empty owner password' case during output encryption.

    • Added test to make sure the user password is not the same as the owner pw.

    • CopyContents also allows ScreenReaders.

    • ModifyAnnotation also sets the FillIn bit.

    • ModifyContents also sets the Assembly bit.

    • Updated docs.

    • Added --version switch.

License

My pdftk code is free software made available under the GPL.

From pdftk.cc:

     This program is distributed in the hope that it will be useful,
     but WITHOUT ANY WARRANTY; without even the implied warranty of
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Sponsors

This work is sponsored and hosted by AccessPDF.


Copyright © 2003 – 2006, Sid Steward