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

GitHub Actions install pdftk

I'm trying to install pdftk for Github Actions Workflow. But it doesn't seem to be working. Any Idea, how to setup PDFTK for Github Actions ? Github Actions Workflow: on: push: branches: [setup_github] pull_request: branches:…
kashif
  • 1,097
  • 4
  • 17
  • 32
1
vote
0 answers

Why are PDF bookmarks created using pdftk not showing in macOS Preview?

I'm trying to add Bookmarks with titles using the following command: pdftk A.pdf update_info metadata.txt output B.pdf When I check B.pdf's metadata, using pdftk B.pdf data_dump output metadata_B.txt, I see the lines I…
deeeeekun
  • 165
  • 8
1
vote
2 answers

geting Error on pdffiller : spawn pdftk ENOENT

I use pdffiller on my project npm install pdffiller and this is my code return new Promise((resolve, reject) => { pdfFiller.fillFormWithFlatten(sourcePDF,distPath,formValues,false,function (err) { if (err) { …
1
vote
1 answer

pdftk: multistamp: [File size increase after multistamp] vs [total text added due to multistamp] looks unreasonable

I have a pdf of filesize 7.5MB and pages 4000 I wanted to add pagenumber at the bottom. So i have another blank pdf of pages 4000 with only pages numbers at the bottom. Its filesize 2MB Now using pdftk option multistamp i am adding page number to…
Santhosh
  • 9,965
  • 20
  • 103
  • 243
1
vote
1 answer

How to add footer to pdf with pdfjam or pdftk?

I am using a shell script to modify many pdfs and would like to create a script that adds the page number (1 of X format) to the bottom of PDFs in a directory along with the text of the filename. I tried using pdfjam with this format: pdfjam…
AAA
  • 2,388
  • 9
  • 32
  • 47
1
vote
2 answers

Combine PDFs with spaces in file names

I have a directory with lots of PDFs that have spaces in their file names. file 1.pdf file 2.pdf file 3.pdf # And so on I ran this command in that directory. pdftk `ls -v` cat output combined-report.pdf But the terminal spat out a bunch of errors…
Username
  • 3,463
  • 11
  • 68
  • 111
1
vote
1 answer

PDF template not merging data properly with pdftk

I'm editing a PDF template with using pdftk command = ("pdftk " + '"' + template + '"' + " fill_form " + '"' + pathUser + user['mail'] + ".xfdf" + '"' + " output " + '"' + …
Mislav
  • 391
  • 5
  • 17
1
vote
1 answer

Google Chrome FDF data unable to be filled into PDF by PDFTK

I have a PDF form that I have set up to send (X)FDF data to a php script, that uses PDFTK to parse the (X)FDF data and flatten it, then save it as a PDF on my system (for testing). Everything functions normally in Adobe Acrobat Pro. But when I use…
reesericci
  • 53
  • 1
  • 8
1
vote
0 answers

Combining pdftk strings for specific pages

I've checked "Similar questions" and went through a lot of search but I can't seem to find a way to combine the snippets I already figured out; would be awesome if someone is able to help. Using pdftk, alternatively running through PowerShell I…
GoetheQA
  • 11
  • 2
1
vote
1 answer

Ghostcript merge image/form with text file

I have an app dependent legacy environment running SCO Unix 5.0.7 that I can install Ghostscrip on. Using a scanned form (lines, boxes, logo, etc) that I've stored as an image (could store it as PDF instead if that helps), I need to be able to (1)…
David
  • 11
  • 1
1
vote
0 answers

Concatenate pdf and add table of contents

I have several pdf files (say chapters of a book) and I want to concatenate them and add a table of contents to the resulting pdf. No original pdf file has a table of contents. Simple numbers as the table of contents is more than fine. I know that I…
kyticka
  • 604
  • 8
  • 19
1
vote
0 answers

php-pdftk permission issue on debian 9

I'm facing an issue with php-pdftk on debian 9. I want to edit and merge some PDF files, but I can't save it. I get the following error when I call $pdf->saveAs('some_path.pdf'); I already tried solutions from this post, but not working. Someone…
Flyzzx
  • 458
  • 5
  • 13
1
vote
0 answers

Is there a way to execute a PDF field script while filling its form with pdftk?

I've been tasked to fill a pre-made PDF form via a Symfony app. I'm using this pdftk wrapper to do the job, but there's an issue. This PDF uses some scripts for hiding/showing some field: for example, they trigger when a radio button has been…
Elsifo
  • 31
  • 3
1
vote
1 answer

How can I extract images from a PDF in linux while preserving transparency?

I've tried using pdfextract to extract images from a PDF and while it does extract the images I want, it extracts them with a black background. However, it also extracts a "mask" image, which I believe is the alpha channel. I've read through…
Ben Davis
  • 13,112
  • 10
  • 50
  • 65
1
vote
1 answer

Heroku PDFTK throwing vague EPIPE and EACCES error

I have an app on a heroku hobby web dyno running a fairly basic node api. We have a series of pdf's that get attached to a pdf generated by puppeteer. My code works when I run it locally (windows) but it also works when I deploy to a my production…