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
2
votes
1 answer

Why pdftk produced pdf files will not render in Firefox?

I have a site - www.jcrocetta.com. On this site I have 2 pdf files. One file has blurred data and the other is clear, both files were created with pdftk. In order to blur out some personal data in the pdf I used Inkscape. But Inkscape only…
2
votes
2 answers

spaces in bash scripts

So, I've been trying for a while and this really won't work. I'm trying to write a script that will concatenate many pdf files into one without the tedium of specifying them at the command-line interface (they all have similar names). #!/bin/bash…
2
votes
1 answer

pdftk wrapper for Ruby

There are several Ruby wrapper gems for pdftk. Among them, is there any gem that installs the pdftk binary automatically cross major OSs at installation of itself? I want to require it in a library, and I can manually install pdftk on my own…
sawa
  • 165,429
  • 45
  • 277
  • 381
2
votes
2 answers

Use Adobe reader instead of chrome pdf viewer to display a pdf

I'm outputting a pdf which has been made with scribus, and in all browsers except for chrome it outputs fine, however with chrome the letters are cut off and lower than usual. I found that disabling the chrome pdf viewer fixes the issue locally. But…
Rayfloyd
  • 273
  • 3
  • 17
2
votes
1 answer

trouble getting php exec() to run

I am trying to get the below command to run but it is not running as far as I can tell because the file is not being generated. I am not getting any error messages at all, this command was working fine when I was testing it on my linux box but I am…
Yamaha32088
  • 4,125
  • 9
  • 46
  • 97
2
votes
2 answers

Include pdftk in a distributable Python module

How can I include pdftk and gsprint with a distributable Python program? I've written a short Python module that takes several source PDFs, rearranges pages, and then prints them into correctly-ordered, helpfully-stapled packets (I'd be grateful for…
Matt Parker
  • 26,709
  • 7
  • 54
  • 72
2
votes
2 answers

How can I inject a dynamically generated image (barcode, as it happens) into a PDF document (I'm in rails if that matters)?

I'm aware of pdf-stamper, but I'm trying to avoid switching everything to jruby right now. I just need to "stamp" an image that I generate within the rails app (a PDF417 barcode) into a form field in the PDF document (there's an FDF; it's a document…
Troy
  • 710
  • 1
  • 10
  • 18
2
votes
2 answers

getting two A6 complete booklet sequences from an A4 page

I have an a6 pdf book. I'd like to convert it to an a4 pdf so that when I print it, I can cut the a4 page in two (upside and downside will have the same content, so I'll end up with two copies of the book) and when putting together the pages, they…
Juanjo Conti
  • 28,823
  • 42
  • 111
  • 133
1
vote
3 answers

Delphi procedure execute program with more than 512 chars

I need to call an external program from Delphi 2006 code with a long list of arguments, specifically to concatenate mutiple PDFs into one file using PDFTK. The full string to be executed has over 512 characters, but both WinExec and ShellExecute…
JamesW
  • 849
  • 2
  • 14
  • 27
1
vote
2 answers

Win bat file: How to get the result of FIND into a new variable?

The pdftk tool "dump_data" function can be used to deliver meta information about a pdf, including the number of pages. The following command... pdftk test.pdf dump_data | find "NumberOfPages" ...outputs the full data dump line, for…
Cambiata
  • 3,705
  • 9
  • 35
  • 45
1
vote
1 answer

Run pdftk by php on linux centos

I would like to run pdftk on my webserver. It's a Linux Centos with PHP 5.3.2. When I connect it by commande line I do pdftk --version It's OK pdftk A=p1-9.pdf cat A1 output p1.pdf It's OK. Now, I do this by php : exec(pdftk A=p1-9.pdf cat A1…
Seb Gy
  • 140
  • 1
  • 5
  • 15
1
vote
0 answers

Check if PDF is fillable

I've a huge amount of PDF files, and I need to determine programmatically which ones are fillable and which ones are not (because of the PDF security options). Is there any way to do that? So far the best solution I've tried is a batch script based…
AJPerez
  • 3,435
  • 10
  • 61
  • 91
1
vote
1 answer

Create multiple PDF files from one large PDF file based on page

I have a large PDF file containing employee information. One page per employee, 500+ pages. I need to create a single PDF file per employee by splitting out this large file into smaller ones. I researched similiar questions regarding that subject…
RobinOlsen
  • 33
  • 7
1
vote
0 answers

How can I fill a PDF template with data in PHP?

I've been looking for and trying solutions for 2 days now. Can't seem to find anything that works. Problem: Given a fillable PDF, I need to take data from a database and put it into the pdf, then allow the user to download it. Context: The PDF is…
Dylan Buth
  • 1,648
  • 5
  • 35
  • 57
1
vote
1 answer

How to create repaginating sequences for booklet printing as output for pdftk?

I'm creating a workflow for booklet printing with 2 pages on an open spread: Use R to create the page sequence Use pdftk to repaginate the pdf Use lp to print the 2-up booklet I've written a loop for repaginating pdfs for booklet/saddle stitch…
Rain
  • 13
  • 2