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
10
votes
2 answers

pdftk will not decompress data streams

I have been trying to work with pdftk to inspect information from compressed pdf streams created by Nitro Reader, but pdftk will not deflate the streams. It produces no errors, but it does not seem to do anything beyond reordering the pdf objects. …
James Duvall
  • 456
  • 1
  • 4
  • 13
10
votes
4 answers

How to add pdftk to Heroku Cedar app?

I need to merge multiple PDF files into one in my Heroku Cedar Rails app, and have settled upon using pdftk to do this. I'm lost as to how to do this. I think the best approach would be to create a custom buildpack that includes a compiled binary…
millie
  • 235
  • 1
  • 10
10
votes
4 answers

Convert HTML form data into a PDF file using PHP

I have been looking and testing this for a couple days now and was wondering if anyone could point me in a different direction. I have a very long job application HTML form (jobapp.html) and a matching PDF (jobpdf.pdf) that have the same field…
Djacksway
  • 447
  • 4
  • 7
  • 16
9
votes
4 answers

Merging two a5 pages into a singe a4 page (without using pdfnup)

I am using Dompdf to generate A5 pdf documents from a html template and Pdfnup (Part of Pdfjam) to combine them into a nice single A4 sheet, which helps saving some paper when printing :) # Generate an a5 pdf php dompdf.php mytemplate.html -p 'A5'…
Andrea Fiore
  • 1,628
  • 2
  • 14
  • 18
9
votes
6 answers

PDFtk throws a Java Exception when attempting to use 'fill_form' function

I have a PHP application that fills out a form from a database call. At present I am putting this together using PDFtk, I am able to run a number of PDFtk commands with no issue and I am currently working out the desired command at command line. My…
user3192649
  • 313
  • 1
  • 4
  • 13
9
votes
3 answers

PDFTK not working to fill out pdf form created in livecycle

I created a form in livecycle es 2 and i am trying to use pdftk to fill out the form but it doesn't work. It says it fills it out successfully but when i try to open the pdf it just gives me an error saying "If this message is not eventually…
Brad Hazelnut
  • 1,603
  • 5
  • 21
  • 33
9
votes
0 answers

How to change (offset) page numbering in PDF

I have been using pdftk to do a lot of scripting with pdf, but I am open to anything that can be done programmatically in linux, ideally through command line or python API. I would need to change the page numbering in a pdf, i.e. make it so that it…
joelhoro
  • 890
  • 1
  • 9
  • 20
8
votes
1 answer

Join multiple PDF files into a single page PDF - positioned join using PHP

This is not an attempt to join separate PDFs to one single PDF with multiple pages. It is an attempt to create a single page PDF from few other PDFs that already exists. I need to do this using PHP and the server is CentOS. I am already generating a…
dakdad
  • 2,947
  • 2
  • 22
  • 21
8
votes
2 answers

How to launch a pdftk subprocess while in wsgi?

I need to launch a pdftk process while serving a web request in Django, and wait for it to finish. My current pdftk code looks like this: proc = subprocess.Popen(["/usr/bin/pdftk", "/tmp/infile1.pdf", …
user85461
  • 6,510
  • 2
  • 34
  • 40
8
votes
5 answers

Statically compile pdftk for Heroku. Need to split PDF into single page files

So we're using heroku to host our rails application. We've moved to the cedar stack. This stack does not have the pdftk library installed. I contacted support and was told to statically compile it for amd64 ubuntu and include it in my…
Binary Logic
  • 2,562
  • 7
  • 31
  • 39
8
votes
1 answer

PDFtk Server on macOS High Sierra 10.13

I'm currently running PDFtk Server successfully on macOS Sierra without issues with @Sid Steward's update pkg file found here: PDFtk Server on OS X 10.11. Yet I have reservations moving to High Sierra because the new Apple File System (APFS) is…
Aaron
  • 3,068
  • 2
  • 21
  • 44
8
votes
1 answer

Merge multiple pdf pages into specific pdf page using pdftk

I have merged.pdf file with 18 pages. I would like to merge into source.pdf file starting from page 46 and get final.pdf using PDFTK I tried with this command, but it didn't work: pdftk A=source.pdf B=merged.pdf cat A1-45 B1-18 A64 output…
Blackcoat77
  • 1,574
  • 1
  • 21
  • 31
8
votes
4 answers

How do I install Pdftk on my server?

I am using a Linux Server and am trying to install Pdftk, but I am problems trying to figure out what exactly to do. I found the following documentation on how to install it, but they refer mostly to installing it on the local Windows machine. They…
zeckdude
  • 15,877
  • 43
  • 139
  • 187
8
votes
2 answers

Remove multiple embedded font in pdf created with pdfTk

Is there a way to remove fonts embedded multiple time from a pdf file? This is my scenario: 1) a program generates several one-page pdf reports (querying a db, putting the info on an excel template and exporting the formatted information in pdf) 2)…
AleV
  • 323
  • 4
  • 15
7
votes
3 answers

How to crop PDF margins using pdftk and /MediaBox

I used pdftk to uncompress a PDF and then opened it as a text file. I want to edit the /MediaBox field, which is in my case /MediaBox [0 0 612 792] I would like to reduce the margins, for instance /MediaBox [100 0 512 792] Unfortunately it…
RockScience
  • 17,932
  • 26
  • 89
  • 125
1 2
3
33 34