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
3 answers

Repair apparently damaged pdf and reduce file size

I have a PDF file (4.6MB) which was made by combining 6 different PDFs (containing both text and bitmap graphics) using pdftk in Ubuntu 12.04. I wish to compress this file to something close to 2MB without affecting its quality. I have tried pdftk's…
Harsh Purwar
  • 57
  • 1
  • 7
2
votes
6 answers

Can't execute external process with PHP

I have the following code function generate_pdf() { $fdf_data_strings = $this->get_hash_for_pdf(); #$fdf_data_names = array('49a' => "yes"); $fdf_data_names = array(); $fields_hidden = array(); …
Zaffar Saffee
  • 6,167
  • 5
  • 39
  • 77
2
votes
2 answers

passthru not working in pdftk

I am new so ssh and terminal commands I am installed pdftk on my web server (Linus Cent-Os dedicated virtual server) using the stack overflow. Although got initially problems because all of my experience was GUI, but somehow following the…
Zaffar Saffee
  • 6,167
  • 5
  • 39
  • 77
2
votes
1 answer

pdftk - fill_form leads to "This document contained certain rights" dialog?

I'm using pdftk and the fill_form command to fill in a PDF form from FDF data. When I execute the command the PDF output is created successfully except that when opening the PDF : A dialog appears in Acrobat reader says "This document contained…
shearichard
  • 1,095
  • 1
  • 17
  • 35
2
votes
1 answer

Mass PDF form fill

I need to fill in a single PDF template multiple times and concat the results. When I say multiple, I mean up to a few hundred times, potentially over one thousand. I can do this with pdftk fill_form, one by one, and then use pdftk cat. We can…
Daniel Huckstep
  • 5,368
  • 10
  • 40
  • 56
2
votes
1 answer

Working with PDF Forms and PDFTK & PHP

I have a PDF that I am using PDFTK to rip the fields out of. My problem is that the order of the fields and field names are not very clear in the field dump. For example: Checkboxes are given field name "box7", "box3", "box2". I do not know which…
2
votes
1 answer

Fill pdf form image field with image

I have tried to use pdftk to fill a PDF form with text and images. Filling out text fields works fine, but it cant seem to add an image to an PDF form image field. Is there any way to add an image to a form field with pdftk ? Or any other way to do…
Vindur
  • 364
  • 3
  • 12
2
votes
1 answer

Using powershell to merge PDFs in multiple subfolders with pdftk and then delete original PDF files

I have a root folder that contains many subfolders, each with multiple PDFs. I then have a powershell script that goes through the folder structure and creates a merged PDF file (using PDFtk) for each subfolder as follows: $pdftk = "C:\Program…
user15229415
  • 45
  • 1
  • 5
2
votes
0 answers

How To Write Non-English (Persian) Characters in PDF Forms using pdftk?

i am trying to write non english characters (persian) on pdf forms using pdftk . i use this command : pdftk pdf_file.pdf fill_form fdffile.fdf output output.pdf but i get this result in output pdf file : i see blank squares [] [] [] [] instead of…
2
votes
0 answers

pdftk not able to open file

I am trying to fill data into a pdf from a xfdf file. pdftk /templates/pdf/2018/data_file_1.pdf fill_form /tmp/input_xfdf.xfdf output /tmp/output.pdf But It is showing this error. Error: Failed to open form data file: /tmp/input_xfdf.xfdf No…
shivankgtm
  • 1,207
  • 1
  • 9
  • 20
2
votes
2 answers

Fill out "fillable pdf" with HTML form "post" data using python?

I am trying to build a small flask web app that displays a job application built from an HTML form with many fields for an applicant to fill out. I want to grab the inputted data from this HTML form, and use the data to fill out a "fillable PDF"…
2
votes
2 answers

Watermarking with Prawn (using templates)

I need to be able to watermark a document that was created from a template. I have the following code right now: # Note: the raw PDF text (body variable below) is sent from a remote server. Prawn::Document.new(:template => StringIO.new(body),…
RobH
  • 568
  • 5
  • 13
2
votes
1 answer

Filling pdf forms with non-English characters

I am filling pdf forms and serving them to users on my express web server: const pdfFillForm = require('pdf-fill-form'); let FillData = { text: 'Title' } const pdf = pdfFillForm.writeSync(Form.path, FillData, { "save": "pdf" }…
SpeedOfRound
  • 1,210
  • 11
  • 26
2
votes
0 answers

how to extract outline of pdfs from pdf bundle file and write it to csv file using bash script or node.js

I have a pdf bundle,i need to extract outline name of each pdf and write it to csv file using bash script or node.js.I am using pdftk library in bash script.In bash script i have use this command pdftk input.pdf burst output…
Sherin Green
  • 308
  • 1
  • 3
  • 18
2
votes
0 answers

Merging xfdf into template pdf without losing some special characters (eg. ő,Ű,č)

I have an xfdf file, which is utf8 and may contain non ASCII characters. I would like to merge it with the pdf that contains the form. I tried with pdftk, and although merging happens correctly - in terms of all fields are being populated - some…