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

Change text in PDF

I have a PDF and I want to programmatically change text, not fonts, colors, just letters. I tried pdf-toolkit - just metadata prawn - templates not supported any more combine_pdf - some fonts not supported Is there easier way to change just text?…
DonPaulie
  • 2,004
  • 17
  • 26
3
votes
1 answer

PDFTk works on local but not working on private server

I have private server CentOS 6 and I have installed pdftk program to generate pdf files. When I connect with SSH client, I can run pdftk program successfully. But I couldn't in php with exec() function. I have a very simple php file as shown below.…
Furkan KESKIN
  • 168
  • 3
  • 16
3
votes
0 answers

GC Warning when running PDFTK command in PHP script

My PHP script generates a PDF using pdftk. When it runs pdftk I get the error status 134 and the pdf is not generated. Weirdly if I run that exact same pdftk command in SSH shell it works. What does the status code 134 mean? And what could be going…
sazr
  • 24,984
  • 66
  • 194
  • 362
3
votes
0 answers

Cyrillic letters not displaying in PDF generated by pdftk

The problem is that Cyrillic letters not displaying in PDF form created with pdftk, specifically using mikehaertl/php-pdftk package: When clicked, the symbols are displaying: In Windows 10 Acrobat Reader similar file looks like this: Here is the…
Peter Reshetin
  • 925
  • 1
  • 7
  • 13
3
votes
0 answers

Cannot getxfa data from form pdf using pdftk

I want to extract XFA data from PDF using PDFTK library or using command line. PDFTK provided drop_xfa but i want to extract xfa from form pdf. How i will achieve this using pdftk. I have tried or search so many thing on google but not getting…
Lakhan
  • 12,328
  • 3
  • 19
  • 28
3
votes
2 answers

Remove First Page from a Series of PDFs

I have a series of PDFs (Computer Gaming World issues) and I want to remove the first page from the pdf file of each issue. There are 100 issues, so a GUI is just not gonna cut it. I used pdftk to remove the first page from one issue: pdftk…
Richard Martinez
  • 692
  • 1
  • 8
  • 16
3
votes
3 answers

PHP exec() not working - exiting early? no error?

i am using PHP to run exec() on a script which looks like this: exec("pdftk xx.pdf fill_form xx.fdf output xx.pdf flatten"); the strangest thing is that when i log in to ssh and put the command in manually - it works fine! it outputs a 224k pdf.…
dan
  • 97
  • 1
  • 1
  • 7
3
votes
2 answers

How to run pdftk on elastic beanstalk

I am trying to run pdftk on an Elastic Beanstalk. The first problem I run into is that I cannot install pdftk on an instance of a Amazon Linux AMI because one of the dependencies (gcj) is not supported. One of the options I am looking at is…
BBS
  • 1,351
  • 2
  • 12
  • 27
3
votes
3 answers

Converting .ps to .pdf and removing a single page

I have a postscript file of a poster made in latex, and want to convert this to a pdf (I'm using ubuntu) I am using ps2pdf but if possible I would like to remove the first, blank page, and keep only the second page. Is there a command that allows…
anthr
  • 1,026
  • 4
  • 17
  • 34
3
votes
2 answers

Parsing pdftk dump_data_fields using PHP?

I need some advice on what's the best way to parse the output given by pdftk dump_data_fields using PHP? In addition, the properties that I need to extract are: FieldName, FieldNameAlt and optionally FieldMaxLength and FieldStateOptions. FieldType:…
aqua
  • 377
  • 4
  • 17
3
votes
2 answers

Any Tricks to Use in wkhtmltopdf and pdftk to Reduce File Size?

I'm using wkhtmltopdf on OS X, and while it has been generally working as intended, the size of the files it generates is larger than I had hoped for. My goal is to essentially save a screenshot of the text content webpage as a pdf, and I don't…
dwm8
  • 309
  • 3
  • 16
3
votes
2 answers

Clone PDF file in a single page

I've got a PDF file which is exactly 1/5 of the size of an A4 page, and a script to convert it into a single A4 page by appending it repeatedly. The problem is that ImageMagick only works with bitmap graphics, and my PDF contains text and detailed…
l0b0
  • 55,365
  • 30
  • 138
  • 223
3
votes
2 answers

PDFtk error when doing any command on Mac OS X

We have installed PDFTK server edition on Mac OS X 10.10 and Ubuntu 12 and Ubuntu 14. When trying to do a dump_data_fields for any PDF it seems to throw a weird error before even getting to that operation.. $ pdftk SchoolPermissionSlip.pdf…
bjm88
  • 690
  • 1
  • 8
  • 16
3
votes
1 answer

ITextSharp/Pdftk: place Base64 Image from Web on PDF as Pseude-Signature

I am trying to conceptualize a way to get base64 image onto an already rendered PDF in iText. The goal is to have the PDF save to disk then reopen to apply the "signature" in the right spot. I haven't had any success with finding other examples…
MizAkita
  • 1,115
  • 5
  • 21
  • 52
3
votes
0 answers

Attach Generated PDFTK/iTextSharp PDF to MemoryStream to Mail

I have a PDF being generated by PDFTK (PDFToolkit). I am trying to add the ReturnedPDF which gets saved to the downloads folder to a MailMessage in C#. The PDF downloads with no problem; however, attaching isn't going so well. var pdfContents =…
MizAkita
  • 1,115
  • 5
  • 21
  • 52