PDFtk is a command-line tool for working with PDFs

Submit command line tools that you find here.
Post Reply
Message
Author
User avatar
lintalist
Posts: 434
Joined: Sat Apr 19, 2014 12:52 am
Contact:

PDFtk is a command-line tool for working with PDFs

#1 Post by lintalist »

PDFtk is mentioned several times on the forum but not as separate thread or (CLI) application, there are two portable Guis, PDFTK Builder and GUI for PDFTK

PDFtk is a command-line tool for working with PDFs. It is commonly used for client-side scripting or server-side processing of PDFs.

Database entry: https://cli.portablefreeware.com/?id=557

Note that "server" doesn't meant it can not run just as CLI, see "installation" below.

PDFtk (Server) does not require Adobe Acrobat or Reader, and it runs on Windows, Mac OS X and Linux.

Website: https://www.pdflabs.com/tools/pdftk-server/

PDFtk (Server) can:
  • Merge PDF Documents or Collate PDF Page Scans
  • Split PDF Pages into a New Document
  • Rotate PDF Documents or Pages
  • Decrypt Input as Necessary (Password Required)
  • Encrypt Output as Desired
  • Fill PDF Forms with X/FDF Data and/or Flatten Forms
  • Generate FDF Data Stencils from PDF Forms
  • Apply a Background Watermark or a Foreground Stamp
  • Report PDF Metrics, Bookmarks and Metadata
  • Add/Update PDF Bookmarks or 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)

License: GPL
"You can use PDFtk Server at no charge under its GPL license."
PDFtk Server Redistribution License
"If you plan to distribute PDFtk Server as part of your own software, you will need a PDFtk Server Redistribution License. The exception to this rule is if your software is licensed to the public under the GPL or another compatible license."
Source: https://www.pdflabs.com/docs/pdftk-license/

Installation - Windows

Download the Windows Installer: https://www.pdflabs.com/tools/pdftk-server/
Uniextract the Installer, copy these two files:

Code: Select all

{app}\bin\pdftk.exe
{app}\bin\libiconv2.dll
and if you wish the documentation - also available when you type: pdftk --help

Code: Select all

{app}\docs\pdftk.1.html
{app}\docs\pdftk.1.txt
as long as pdftk.exe and libiconv2.dll are either in the same folder or available in your PATH it works

User avatar
vevy
Posts: 795
Joined: Tue Sep 10, 2019 11:17 am

Re: PDFtk is a command-line tool for working with PDFs

#2 Post by vevy »

Thanks. Seems to have a bit of a learning curve.
There is also the official GUI front-end: viewtopic.php?f=20&t=21856

User avatar
Cornflower
Posts: 244
Joined: Fri Aug 31, 2007 7:58 am
Location: Canada's capital

Re: PDFtk is a command-line tool for working with PDFs

#3 Post by Cornflower »

In fact, there are a few GUIs for pdftk. My favourite is pdftkBuilder (https://www.portablefreeware.com/index.php?id=1066) by Angus Johnson, who has kept it up since 2004 or earlier to my first usage.
Another is Dirk Paehl's GUI for pdftk (https://www.portablefreeware.com/index.php?id=17), though it appears this has not been updated for many years.

One good way to use pdftk natively is to use the examples from the PDF Labs (maker of pdftk) web site, here (https://www.pdflabs.com/docs/pdftk-cli-examples/). If you want to go the extra mile, O'Reilly produced the book [PDF Hacks](https://www.amazon.com/exec/obidos/ASIN ... m/pdftk-20) back in 2004 just to make pdftk sing.

User avatar
lintalist
Posts: 434
Joined: Sat Apr 19, 2014 12:52 am
Contact:

Re: PDFtk is a command-line tool for working with PDFs

#4 Post by lintalist »

I use it every day, such a great tool to have at hand in batch files to automate work flow when dealing with PDFs.

Post Reply