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

how to get total number of pages using pdftk?

i am using pdftk to get total page number of a pdf file in php. I am using the code. my pdftk.exe file is in assets/pdftk folder and my pdf file is in Files folder $command = '../assets/pdftk/pdftk.exe '; $command.="../Files/" .…
user3789344
  • 81
  • 1
  • 3
  • 14
3
votes
2 answers

node.js child process doesn't work in node webkit

I made a small app with node webkit. Pre-packaging, it works fine. But after I zipped it and added it to Contents/Resources in node-webkit.app I get an error when I run the app. It opens fine, but the task it does involves child processes, and I…
lpappone
  • 2,755
  • 2
  • 15
  • 15
3
votes
2 answers

Checking checkbox with pdftk library in Ruby on Rails

I have an application when customer is registering and when he complete the registration he's got filled pdf template. To fill pdf templates I use this gem: https://github.com/jkraemer/pdf-forms But with this library I don't know how to check…
Mateusz Urbański
  • 7,352
  • 15
  • 68
  • 133
3
votes
2 answers

How can I drop metadata fields (e.g., PageLabel fields) from PDFs?

I have used pdftk to change the "Info" metadata associated with a PDF. I currently have several PDFs with extraneous page labels and I cannot figure how to drop them. This is what I am currently doing: $ pdftk example_orig.pdf dump_data output…
mako
  • 473
  • 6
  • 14
3
votes
3 answers

Getting PDFTK installed on heroku Cedar Stack for use in my app

so I have building management app, which locally uses the pdftk to generate pdf forms (prefilled with tenant/expense data). Works like magic on my local machine. However, on Heroku I get the error: pdftk executable /usr/local/bin/pdftk not found in…
msadoon
  • 143
  • 2
  • 11
3
votes
1 answer

batch set var in for loop

I am working on making a list of pdf files. There are 2480 pdfs in the directory. I want to put the first half in var l1 and the second in var l2. for /r %%f in (*_*.pdf) do ( set c=%%~nf set c=%c:~5,4% if %c% LEQ 1240 ( set l1=%l1% %%~nf.pdf…
mbunch
  • 560
  • 7
  • 21
3
votes
3 answers

how to get pdftk to burst to source file name plus page number?

How can I use pdftk to burst to the same filename as the source file plus a number? Sample input source.pdf Desired output source-1.pdf (it is ok if page number has leading zeroes, but not required) source-2.pdf Maybe I could use a .bat file to…
Maa421s
  • 63
  • 2
  • 6
3
votes
1 answer

pdftk error when using checkbox on pdf form

When I use checkbox on pdf form, pdftk gives the following error and does not create output pdf. Unhandled Java Exception: Unhandled Java Exception: java.lang.NullPointerException at gnu.gcj.runtime.NameFinder.lookup(libgcj.so.12) at…
hyhr
  • 91
  • 1
  • 3
3
votes
1 answer

Pdftk form filling font resize

I'm using pdftk to fill inputs in a pdf form. I have no problem to generate a XFDF file and merge data & template, but sometimes the value is longer than the field, and the text is just cut. Is there a way to adapt the font dynamically, or something…
FLX
  • 2,626
  • 4
  • 26
  • 57
3
votes
2 answers

PHP set proc_open to output directly to user

I'm using proc_open with pdftk to pre-fill some forms with data, this works pretty well, but rather than save the result to a file and then read the file back, I'd like to print the file directly out. I've got this working so I'm not having any…
kyall
  • 403
  • 1
  • 3
  • 11
3
votes
3 answers

Is there a limit on the length of command passed to exec in PHP?

Currently I need to merge that 50+ PDF files into 1 PDF. I am using PDFTK. Using the guide from: http://www.johnboy.com/blog/merge-multiple-pdf-files-with-php But it is not working. I have verified the following: I have tried the command to merge 2…
aandroidtest
  • 1,493
  • 8
  • 41
  • 68
3
votes
3 answers

How to install pdftk on Amazon Linux AMI release 2012.03

I am not able to install the pdftk on Amazon Linux AMI release 2012.03. pdftk requires gcj2.14 and amazon ami provides gcj2.12 package. If I try to install gcj2.14 getting conflicts with the existing gcj package. Please suggest a way to install…
triveni
  • 31
  • 1
  • 3
3
votes
6 answers

Ghostscript script or other, to interleave odd and even pages from two multipage pdf files

My scanner has a paper feed but no duplex scanning. Thus, if I scan a multi-page document that is printed on both sides of the sheet, I will end up with two pdf files, one containing all odd pages (the odd-page pdf file), the other all even pages…
jjbornheim
  • 145
  • 1
  • 4
3
votes
3 answers

pdftk + xfdf + php can't handle umlauts

I'm using XFDF files to fill out PDF-forms serverside with PHP and pdftk but my problem is that no non-english characters (ä, ö, å etc.) are printed to the form fields. Here is the function I use to parse the XFDF file: function…
dmni
  • 31
  • 1
  • 5
3
votes
2 answers

Why does repeated bursting of a multi-page PDF into individual pages via pdftk change the md5 checksum of those pages?

I'm using pdftk and doing some testing and finding that bursting a multipage PDF file into separate single page PDF files, and then generating an md5 hash checksum (digital fingerprint) for each of those single page PDFs results in a different hash…
k00k
  • 17,314
  • 13
  • 59
  • 86