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

How to use pdftk with python without creating physical file on disk?

I'm using pdftk and python to pass http post data to a request handler that generates and returns a pdf file as an http response. Here is my current code: import os from fdfgen import forge_fdf from django.views.generic.edit import FormView from…
John Phillips
  • 896
  • 6
  • 11
2
votes
1 answer

Can't rotate in pdftk

I am following the online instructions and trying to rotate all pages of a PDFs 90 degrees clockwise like so pdftk in.pdf cat 1E output out.pdf But then I get the following error Error: Unexpected text in page range end, here: 1 Exiting. …
puk
  • 16,318
  • 29
  • 119
  • 199
2
votes
0 answers

Using PDFTK, input pdf is not an acroform, how to make it an acroform

I am using pdftk in my web app.. first I am merging 3 pdf templates with fillable forms into one pdf template with fillable forms (let's call it 'simple.pdf'). Then, I want to go further and fill in 'simple.pdf's custom fields but I am getting the…
penguinsource
  • 1,120
  • 3
  • 16
  • 40
2
votes
1 answer

Merging PDF files with similar names using PDFTK and a bash script

I have a directory with a few hundred PDFs in it. All of the PDFs filenames begin with a 5 digit number (and then have a bunch of other stuff at the end). What I need to do is merge any PDFs together that start with the same 5 digit number. Thoughts…
RoccoMaxamas
  • 339
  • 2
  • 5
  • 14
2
votes
2 answers

How to reuse a path in PDF generation?

I am learning the PDF "syntax" and try to create various PDF documents manually (on Windows 7, Notepad++ to write the 1st unreferenced, broken, file, then run them through pdftk to produce a valid file with updated references, as explained here...).…
Janthelme
  • 989
  • 10
  • 23
2
votes
1 answer

[Steganography ]Hiding Data in PDF files

I'm trying to hide a file in a PDF file code. I've already search some information to help me. I've tried to uncompress the pdf using pdftk ( pdftk pdf.pdf output uncompress.pdf uncompress ). Then I tried different things such as : Insert…
Prygan
  • 95
  • 1
  • 9
2
votes
1 answer

Multipage background in PDF, using pdftk or other tool

How to add multipage background (eg. odd and even backgrounds) to 10 thousands pages PDF, with keeping output file as small as possible? I'm doing massively multipage documents (eg. 10000 pages in one document). Each page has background, which I…
maho
  • 128
  • 6
2
votes
1 answer

Overlaying two PDFs using PDFtk - stamp gets cropped

I have two PDFs from two different sources that are exactly the same size. I want to overlay one on top of the other. Output from pdfinfo -box -f 1 -l 3 top.pdf: Creator: cairo 1.10.2 (http://cairographics.org) Producer: cairo 1.10.2…
mmcg
  • 23
  • 4
2
votes
2 answers

Cannot retrieve the fields name from form PDF using pdftk

When I try to using pdftk my.pdf dump_data_fields >result.txt have empty data result
2
votes
1 answer

Input PDF format for PDFTK form fill

Is there a specific input format for the file for using pdftk to fill form fields (via PHP). The input PDF I have is a Acrobat 9 created form. I've tried "pdftk in.pdf output out.pdf" and tried combinations of the flatten and drop_xfa…
2
votes
2 answers

Combining Java and C without gcj -- move C to Java or Java to C?

First, I have no experience doing this. But like the beginning of any good program, I have problem that I need to fix, so I'm willing to learn. So many of you are probably already familiar with pdftk, the handy utility for handling various…
Anthony
  • 36,459
  • 25
  • 97
  • 163
2
votes
1 answer

Issues trimming and combining PDFs with `pdftk`

Having some issues using pdftk. I'm trying to get the second page of every PDF in a specified directory and combine them into one output file. Note: the PDF files in question were created with wkhtmltopdf. I change into the directory and run the…
jcuwaz
  • 187
  • 3
  • 14
2
votes
3 answers

merging XFDF with PDF form to create final PDF server-side?

This is what I have currently: User submits form data and gets a "download PDF" link. The link points to script which generates an XFDF file on the fly and outputs the XFDF file after setting the appropriate headers, etc. The XFDF file points to a…
Anthony
  • 36,459
  • 25
  • 97
  • 163
2
votes
2 answers

pdftk stamp is stripping links

I'm trying to stamp one PDF file (multiple pages) with another (single page) PDF file by using pdftk stamp operation. pdftk large.pdf stamp stamp.pdf output stamped.pdf Now, stamp.pdf contains a single page with a single line of text at the…
pbradaric
  • 21
  • 3
2
votes
1 answer

Can't generate proper PDF files with PDFtk

I am developing a web app using Ruby on Rails 3. One of the features of the app is to use data from a MySQL database to fill PDF template forms that have been designed in Adobe LiveCycle Designer. I am using the technique of generating an XFDF file…
Nik
  • 21
  • 4