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

Reading PDF plots, arranging them on a grid, save in one-page PDF using R

I have 3 R plots saved as pdf files (upper_left.pdf, upper_right.pdf, lower.pdf) as vector graphic and want to make a one-page pdf file and arrange them on it as follows: What I have tried already I have tried reading the pdf's using…
psyguy
  • 312
  • 3
  • 16
2
votes
1 answer

Write EPIPE error when filling form using node-pdftk

I am trying to fill a pdf form using nodejs. Im trying to use node-pdftk package for the same.Did following steps: Installed pdftk for windows mapped the path to the environment variables PATH installed node-pdf package `const express =…
2
votes
2 answers

using PHP to create PDF, without using PHP's FDF functions

Is there any way to create a FDF file within PHP without using the dead FDF functions? I am aware that you can use pdftk to create a PDF from an existing FDF file, but I need to create the FDF file first with one field value set. Or, is there a way…
Chalise
  • 3,656
  • 1
  • 24
  • 37
2
votes
2 answers

Merging .pdf files with Pdftk

I have many .pdf files on a folder. Also i have a .bat script that works together with Pdftk program. But when i execute the .bat it isn't working. Follow my script: @echo off setlocal enabledelayedexpansion FOR %%A IN (%*) DO (set command=!command!…
user9886488
2
votes
2 answers

Change orientation of landscape pages only in PDF

I have a PDF file exported from LibreOffice Writer. Here is an example. Some pages have portrait orientation, and others have landscape orientation. I am using Linux, and when I view the file in evince or Foxit Reader, it is shown correctly,i.e.,…
2
votes
2 answers

overlay one pdf with another from the command line: pdftk alternative?

I use a bash script to auto-generate a pdf calendar each month.I use the wonderful remind program as the basis for this routine. Great as are the calendars I get using that program, I need a more detailed header for the calendar (than just the name…
MJiller
  • 149
  • 9
2
votes
3 answers

Reordering large PDF files using command line tools

I'm working with PDF files that have hundreds of forms within them. Each form is 2 pages long, so in most files pages 1-2 is the first form, pages 3-4 is the second form, and so on. However, there are several PDF files where the page order of the…
Saewon Park
  • 140
  • 6
2
votes
0 answers

pdftk killing my JavaScript

I have a PDF that uses JavaScript to print as soon as it gets opened. I need to remove certain pages. However, the output that pdftk produces no longer has the JavaScript that makes it print when it gets opened. Is there any way to preserve JS with…
theglossy1
  • 543
  • 3
  • 13
2
votes
0 answers

TOC links becomes invalid or point to wrong pages after Pdftk cat

I have two pdf files (cover.pdf , content.pdf) which I am joining using pdftk. TOC defined in content.pdf are broken/invalid after merge. I am looking for anyway to fix or avoid the problem pdftk cover.pdf content.pdf cat output full.pdf
sakhunzai
  • 13,900
  • 23
  • 98
  • 159
2
votes
0 answers

Anybody else used `pdftk' and `make' together to merge PDF files together?

This year I came up with a means of using pdftk' andmake' to merge PDF files together. This is the latest and most refined iteration of the makefile. Note that this is for a specific file but some names and directories have been changed as I did…
bjem
  • 175
  • 6
2
votes
2 answers

What am I doing wrong here with these variables?

I'm trying to split tempfile.pdf with pdftk according to strings that I found on certain pagenumbers. Those pagenumbers are in tempfile. n=0 prefix1="startpoint" prefix2="stoppoint" while read p; do echo $p > temp `cat temp` = prefix1$n …
Paul Bergström
  • 253
  • 1
  • 2
  • 14
2
votes
1 answer

PDF: How to Optimize Filesize & Convert to PNG (embedded fonts problem)

I have a PDF with embedded fonts that I can't seem to work with. Right now, I'm using GhostScript and trying to do 2 things: Minimize filesize of PDF: gswin32c -dSAFER -dBATCH -dNOPAUSE -dQUIET -sDEVICE=pdfwrite -sOutputFile=output.pdf…
StackOverflowNewbie
  • 39,403
  • 111
  • 277
  • 441
2
votes
1 answer

How to select radio buttons using fdfgen and pdftk?

How to select radio buttons using fdfgen and pdftk? https://github.com/ccnmtl/fdfgen I have tried using the values True, 'true', 1, 'On', 'on', 'Yes', 'Selected'
JV.
  • 2,658
  • 4
  • 24
  • 36
2
votes
1 answer

Fill pdf form and insert image, without Pdftk

is there any possible way to not lose any content, when inserting an image into a filled pdf, i am using the fpdm.php script from here and works prettty good i might add. the pdfs i am using i pass them trough pdftk, as in pdftk.exe insert.pdf…
nonaxanon
  • 237
  • 4
  • 18
2
votes
2 answers

Ruby - using pdftk to split a multi page pdf into many single page pdf's?

I have tried using a gem called docsplit and got nothing but errors; even when trying the documentation examples, they wouldnt work on my windows machine. I ran across a blog post giving me hope that this could be done in pdftk: here I have a pdf…
ADL
  • 185
  • 8
  • 19