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

What different options for password protection does PDF support?

In pdftk I can see three options: 1$ pdftk input.pdf output protected-userpw.pdf userpw very_secret 2$ pdftk input.pdf output protected-ownerpw.pdf ownerpw very_secret 3$ pdftk input.pdf input_pw very_secret output protected-input.pdf When I open…
Martin Thoma
  • 124,992
  • 159
  • 614
  • 958
4
votes
1 answer

pdftk - preserve XMP data while merging

I split & merge some pdf files like this pdftk A=content.pdf B=frontside.pdf cat B1 A5-2 output output.pdf 2>&1 The result is fine but has no XMP data anymore. Is there a way to tell pdftk from which file it shall take the XMP dataset when…
Paflow
  • 2,030
  • 3
  • 30
  • 50
4
votes
3 answers

detect pdf pages that are upside down

We are using php, pypdfocr, and pdftotext to OCR and extract text from documents that have been scanned in or faxed to us. The issue is when the document is scanned or faxed upside down or if some pages are intended to be read landscape (so the…
tempcke
  • 700
  • 8
  • 15
4
votes
2 answers

How to tell what version of `pdftk` you're running?

pdftk -v doesn't do the trick. Neither does pdftk -h. That just fills the screen past the available history with a manual. But it does not tell me what version I'm running. Any ideas? I'm running Windows.
neubert
  • 15,947
  • 24
  • 120
  • 212
4
votes
1 answer

Filling pdf fields with Chinese characters garbled

I am trying to fill a pdf field with Chinese characters from an fdf or xfdf. So far I have tried, pdftk, mcpdf, pdfbox and fpdm. They can all get the characters into the field, but they don't display. When I click on the field to edit, the…
Matthew Wise
  • 55
  • 1
  • 5
4
votes
1 answer

Why is "PDFtk Server" called "PDFtk Server"?

From looking at the PDFtk Server product page, manual, and example usages, it appears that this is not actually a server application - as in runs in the background as a daemon and process requests from clients coming across the network or other…
George
  • 271
  • 3
  • 6
4
votes
4 answers

How do we merge 2 pages in a pdf file on linux

I have a pdf file of 10 pages , and I want to merge every two pages of it into a single page , like 1,2->1 : 3,4->2 : and so on ... I learnt about Ghostscript but these are the tools for compressing the .pdf , also there are utilities to merge two…
user3040487
  • 181
  • 1
  • 3
  • 7
4
votes
1 answer

add a .pdf file(.png basically) to the end of every page in another .pdf file

I have a code.ps file converted to code.pdf , which I want to add to the end of every page in my test.pdf , i.e shrink the test.pdf's every page and add an image to the end of it . I have written the following shell script to it , but it appends the…
user3040487
  • 181
  • 1
  • 3
  • 7
4
votes
2 answers

PDF Compare using pdftk and Ghostscript

I have created a script that combines two PDFs into one side by side, by looking at some of Kurt Pfeifle's answers. But my problem is that the code isn't flexible. By that I mean if one PDF is larger or has another resolution that the other PDF, the…
4
votes
2 answers

automatically imposing 4 pdf pages into A4 sheet following custom order

I want to reassemble my PDF documents to print them on A5 using the A4 format from my printer. Also I need to print two sites (slides) on each A5 page which of course should be double sided. Hence the A4 page is in landscape format. Than I want to…
mcxme
  • 83
  • 1
  • 7
4
votes
1 answer

PDFtk and XFDF file NOT filling in form

I have a pdf template file with form fields (amount_1, amount_2 etc) I created an XFDF file and am using PDFtk via command line to fill the form and flatten the file. However, when I run the command below, the new pdf is created but the fields are…
fredmarks
  • 327
  • 5
  • 14
4
votes
1 answer

Unable to build pdftk from source on fedora machine

I am trying to build pdftk from source on fedora machine. I have unzip pdftk jar and trying to execute make -f Makefile.Redhat But i am getting following error on my console. gcjh-4.7.2 -force…
SleepyThread
  • 215
  • 5
  • 11
4
votes
1 answer

Go from html form to PDF using PHP

Possible Duplicate: Filling PDF Forms with 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…
Djacksway
  • 447
  • 4
  • 7
  • 16
4
votes
1 answer

pdftk field names for insertion

when I do pdftk samplex.pdf dump_data_fields I get back fields with format like: FieldType: Text FieldName: form1[0].Page1[0].Header[0].RepeatHeader[0].Project[0] FieldNameAlt: Project FieldFlags: 0 FieldJustification: Left I have a…
Halcyon
  • 1,376
  • 1
  • 15
  • 22
3
votes
3 answers

How to Convert Doc to PDF

Here is some background info. I'm on a shared linux server with hostgator. I've looked at phplivedocx, pdftk, fpdf, SetaPDF-Merger API, Muhimbi PDF Converter, mbtPdfAsm, http://pdfmerger.codeplex.com/, and pdflib to no avail. My server…
Spartacus
  • 31
  • 1
  • 2