Questions tagged [pdftk]

A simple, GPL-licensed command-line tool for manipulating PDF documents.

Project homepage

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.

Pdftk can

  • 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)
510 questions
170
votes
11 answers

PDFtk Server on OS X 10.11

I've been using PDFTK Server on OSX pre 10.11 for over a year without any issues running commands on the command line. After installing OSX 10.11 beta, I can no longer run any PDFTK Server commands on the command line. It does not throw any error,…
Aaron
  • 3,068
  • 2
  • 21
  • 44
118
votes
13 answers

pdftk compression option

I use pdftk to compress a pdf using the following command line pdftk file1.pdf output file2.pdf compress It works as the weight of my file decreased. Are there [options] to change the compression??? Or maybe other solutions to compress my file? It…
RockScience
  • 17,932
  • 26
  • 89
  • 125
110
votes
1 answer

PDFtk hanging on MacOS Sierra

PDFtk Server seems to be hanging indefinitely on MacOS Sierra. Looks similar to the problem it had on El Capitan. I'm trying to run this command: pdftk test1.pdf test2.pdf cat output out.pdf verbose And am getting no output, just an indefinite…
Nathan Hazzard
  • 1,413
  • 2
  • 12
  • 15
84
votes
3 answers

How to install pdftk on Mac OS X

I want to install pdftk with MacPorts, but this command does not work: sudo apt-get install pdftk Is it possible to install it on a Mac? My system specifications are: Processor: 2.5 GHz Intel Core i5 Memory: 8 GB 1600 MHz DDR3 Graphics: Intel…
user3061922
  • 1,011
  • 1
  • 7
  • 10
82
votes
5 answers

Split a PDF in two

How do you easily split a large PDF into two (or more) separate PDFs? Say we have foo-bar.pdf, section foo is from page 1-12 and section bar is from page 13 till the end. I want foo-bar.pdf split into foo.pdf and bar.pdf.
Dennis
  • 56,821
  • 26
  • 143
  • 139
71
votes
3 answers

Remove the last page of a pdf file using PDFtk?

Can someone please tell me how to remove the last page of a PDF file, using PDFtk?
user1974753
  • 1,359
  • 1
  • 18
  • 32
62
votes
5 answers

How to solve "pdftk: Bad CPU type in executable" on Mac?

I want to use pdftk but I always get this error zsh: bad CPU type in executable: pdftk I reinstalled pdftk and I changed the terminal from bsh to zsh as I found in my search for how to solve this error but without any success. I'm using the latest…
Amr Rady
  • 1,057
  • 1
  • 12
  • 24
39
votes
4 answers

PDFTK Rotating Pages Problem

I'm trying to use PDFTK to rotate pages in my PDF document. Executing something like the following should result in no changes to the page rotation: pdftk in.pdf cat 1N output out.pdf (This is rotating page 1 "north" or "0 degrees.") In some PDF…
StackOverflowNewbie
  • 39,403
  • 111
  • 277
  • 441
38
votes
12 answers

Merge PDF's with PDFTK with Bookmarks?

Using pdftk to merge multiple pdf's is working well. However, any easy way to make a bookmark for each pdf merged? I don't see anything on the pdftk docs regarding this so I don't think it's possible with pdftk. All of our files merged will be 1…
Jason
  • 1,496
  • 4
  • 29
  • 41
34
votes
3 answers

How to find and replace text in a existing PDF file with PDFTK (or other command line application)

I have on each page of my PDF document a line with this string: %REPLACE% Which I'd like to find and replace with another string. Does anyone know how to do this with some command line application such as PDFTK? This folk gave me an important clue…
Roger
  • 8,286
  • 17
  • 59
  • 77
31
votes
2 answers

How to pass variables as stdin into command line from PHP

I am trying to write a PHP script that uses the pdftk app to merge an XFDF with a PDF form and output the merged PDF to the user. According to the pdftk documentation, I can pass the form data in via stdin and have the PDF output to the stdout…
Anthony
  • 36,459
  • 25
  • 97
  • 163
30
votes
6 answers

pdftk split pdf with multiple pages but total size grew

with php i have to split a single pdf file with multiple pages inside it to a lot of PDF file with one page per file. I use pdftk and works fine, but every pdf created for every page is very large size. My original PDF is 7MB (with 70pages inside),…
Simone M
  • 677
  • 1
  • 10
  • 26
24
votes
4 answers

Adding an image to a pdf with pdftk

Hello I am using pdftk to generate a PDF based on a form that is submitted. I have everything working fine until here. Which is adding an image of a signature. I am using signature pad which works great to generate the image file of the signature.…
Brad Hazelnut
  • 1,603
  • 5
  • 21
  • 33
23
votes
2 answers

Font issue with PDFtk

I'm having difficulties filling in a form using pdftk with text fields with true type fonts. Font files (.ttf) are added to /Library/Fonts (OSX Mavericks) The form is created with Adobe Acrobat Pro The form includes normal (non form) text using…
davur
  • 1,420
  • 1
  • 15
  • 37
20
votes
2 answers

pdftk and qpdf to reset PDF commenting security

to be able to add annotations to a pdf file in linux, i have to reset the "Commenting" security setting in the pdf document. qpdf --decrypt input.pdf output.pdf should remove any passwords or "encryption" (according to this post) pdftk input…
user989762
  • 1,686
  • 3
  • 16
  • 20
1
2 3
33 34