Skip to main content

Questions tagged [pdftk]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
24 views

How to concatenate various jpgs pngs and pdf into single pdf leaving their sizes as they where?

I am trying to make a kind of dossier out of various pngs,jpgs and single page pdf images. It has to be a single pdf file, but it doesn't matter that results into something conveniently printable. As ...
wpkzz's user avatar
  • 113
0 votes
0 answers
19 views

Remove PDF pages if content is subset of next page

I have a lot of uni-slides where a list of bullet points gets shown page by page until one slide contains all points. For the sake of explaining a topic this is quite nice but for learning I would ...
BillGatesPriv's user avatar
0 votes
2 answers
59 views

Create pdf output file alternating pages between two files

I have a pdf file, let's call it A, composed of a lot of pages. Then I have a second pdf file, let's call it B, composed of a single page. My goal is to have an output file, let's call it O, with the ...
Mark's user avatar
  • 733
0 votes
1 answer
48 views

Combine PDF forms including filled-in information

I have been trying to file my taxes by filling out the individual forms, which are fillable PDFs on the IRS's website, and concatenating them using the pdfunite command: pdfunite f1040.pdf f1040s1.pdf ...
Mirlan's user avatar
  • 101
0 votes
2 answers
126 views

How to define a multiple page ranges for pdftk with a bash variable

I'm using Arch linux, Openbox window manager, and bash. Everything is up to date with the latest versions. Can anyone tell me why I can't get the "$page_range" variable to show up within ...
Kes's user avatar
  • 859
2 votes
0 answers
158 views

Combine PDFs to new PDF with filenames as bookmarks

I have a directory foo containing .pdf files named with pattern X01, X02, ..., each two pages long. I want to combine them to a new .pdf, named "all_YY-MM-DDTHHMMSS.pdf" that will contain ...
jay.sf's user avatar
  • 227
0 votes
1 answer
123 views

Correcting typo in PDF, other solutions aren't working

I have a job interview on Tuesday, and I need to correct a typo "obestiy" [sic] to "obesity" in a PDF from LaTeX that I cannot recompile due to missing images and tables. I have ...
con's user avatar
  • 109
1 vote
0 answers
319 views

pdftk - WARNING: The creator of the input PDF: has set an owner password

I am trying to merge multiple .pdf files into one. I am getting an error stating there is a password on the files which prevents the consildation but there isn't a password request when I open the ...
mister mcdoogle's user avatar
0 votes
0 answers
753 views

Fixing slow-rendering PDFs on Linux

I've got some large document scans with embedded OCR text on Internet Archive I'd like to read. Unfortunately the PDF pages render very slowly on my document readers (Okular, Evince, Zathura). I ...
KJL's user avatar
  • 1
0 votes
1 answer
779 views

shell script to combine PDF's in a folder and use pdf file name as bookmark

I have a series of folders with employee names and their documents in pdf format. I want to merge and create a single PDF file with pdf documents indexed as bookmarks in pdf file. I tried using PDFTK ...
Bibush GC's user avatar
2 votes
0 answers
397 views

A lot of my old PDF files have become unreadable, and pdftk doesn't seem to help

I have an extensive library of my old publications in PDF format. Recently I found that many of the older ones (as recent as early 2000s) are no longer readable by either okular or xpdf. xpdf says: ...
Jess H. Brewer's user avatar
1 vote
1 answer
3k views

Force pdfjam to fit a specific size in final output

My intentions is to make a full book cover (a wide page including the book’s back, the spine, and the front cover). To achieve this, I have three PDF files containing the front page (first-page.pdf A4 ...
fauve's user avatar
  • 1,278
1 vote
1 answer
2k views

How to remove a specific color from a whole pdf document?

Is their a way, with imagemagick, pdftk or other stuff, to remove a specific color from a whole pdf document? I mean, I give an html hex color code to a tool, and it remove all occurences of this ...
fauve's user avatar
  • 1,278
0 votes
1 answer
214 views

Script for copy bookmarks from one pdf to another

I want to transfer bookmarks from a series of uncompressed pdf files to their compressed copies (these copies do not have the original bookmarks). I know how to do this one by one using pdftk. First I ...
fich's user avatar
  • 330
0 votes
0 answers
411 views

How to secure .pdf file to prevent cut and paste from terminal command line

The goal is to prevent recipients from cutting and pasting text content. All recipients shall have access: there should not be a password obstacle to prevent opening the document. I do not know what ...
gatorback's user avatar
  • 1,394
0 votes
0 answers
56 views

Script portability to MacOS

Context Catalina (zsh) & Homebrew: man pages return successfully for pdftk & ps2pdf The goal is to execute: pdfBatesStamp.sh as described in https://unix.stackexchange.com/a/115537/182280 I ...
gatorback's user avatar
  • 1,394
0 votes
1 answer
55 views

Combine Multiple pdfs with a new page with text between each

I've read through and tried multiple posts on similar topics and none satisfied my purpose. I have multiple pdfs which are project reports for each week of a 16-week project and are titled Week1.pdf, ...
quics-ilver's user avatar
0 votes
1 answer
2k views

How to convert a directory of jpg files to a pdf with filenames as bookmarks?

I have a directory of jpg files that are scans of my handwritten notes. How do I convert them to a single pdf file that has the filenames as bookmarks? (I eventually also want to add ocr. As mentioned ...
jm jm's user avatar
  • 1
0 votes
1 answer
312 views

Printing a PDF to a file (like Evince does)

I need to make a PDF uneditable and a good way to accomplish that is to use the "Print to file" functionality in most PDF readers to generate another PDF. I suppose they work by converting ...
rubik's user avatar
  • 847
4 votes
3 answers
702 views

Eliminate duplicate pages from pdf

I have a pdf document with over 200 duplicate pages among the total 900 of the document. When there is a duplicate, it appears immediately after the original. Maybe with pdftk the job can be done, but ...
fich's user avatar
  • 330
0 votes
0 answers
148 views

How to extract named destinations with its page using only pdftk and grep?

I'm wondering if it's possible to extract named destinations of this PDF using only pdftk and grep.I know it's possible to do the job with pdfinfo -dests. Its output is: Page Destination ...
Kafka4PresidentNow's user avatar
0 votes
1 answer
1k views

methods of PDF compression

The Problem I have a lot of old books that I want to scan and digitize. For this, I use some flatbed scanner, xsane and GImageReader, which works great. Back a few years ago, when I was still using ...
carsten's user avatar
  • 355
1 vote
2 answers
546 views

pdftk does not update PageLabel metadata

I realised that pdftk does not update the PageLabel metadata, when using update_data_utf8. I've got a pdf file (let's call it file.pdf), which contains the metadata PageLabelBegin PageLabelNewIndex: 1 ...
red_trumpet's user avatar
1 vote
1 answer
998 views

pdftk: Too many heap sections: Increase MAXHINCR or MAX_HEAP_SECTS

I was trying to combine 10 pdfs. The total pages are around 100,000 pages. I am using pdftk 1.pdf ... 10.pdf output total.pdf the total size of pdf will be around 300+mb. I get the following error ...
Santhosh's user avatar
  • 409
4 votes
1 answer
5k views

How to remove pages from a PDF while leaving the document otherwise unchanged

I have a PDF book that I want to remove a few pages from to reduce the file size. My normal solution to this didn't work, and when I tried others they introduced new problems: I usually use PDF ...
pez's user avatar
  • 41
3 votes
1 answer
2k views

PDFTK can't find files - anywhere even home folder

Similar to this question , but the solution of moving files to the home directory didn't sort it for me. So I don't think its a problem with permissions. This is the jist of the error I got: Error: ...
joeav's user avatar
  • 131
0 votes
2 answers
1k views

Generate parameters for pdftk with loop in bash

I want to generate a list of file names containing n=1 to k, add the string "cat output xyz.pdf" at its end and pass the result as parameter to pdftk. It should execute as this: pdftk file1.pdf file2....
gnidoc's user avatar
  • 3
1 vote
1 answer
855 views

Fedora -- Pdftk File not found, snap installation

I am running Fedora 31 under KDE. I installed pdftk with the snap store. The installation process finished succesfully. However, when I am trying to execute a pdftk command (for instance here to burst ...
Smilia's user avatar
  • 310
2 votes
2 answers
2k views

how to add more metadata to a pdf file so I have more info

I have been blessed in the context that many a times if I come across some interesting content, debate etc. which involves some pdf, more often than not I have the author mailing me the content/pdf or ...
shirish's user avatar
  • 12.5k
36 votes
5 answers
17k views

Why is PDFTK saying it can't find files that are right there?

I'm trying to compile a bunch of PDFs into a single document. ls shows the files are in the directory that I'm in and they're readable (-rw-r--r--). But when I try to run pdftk 2017.pdf cat output ...
Amanda's user avatar
  • 1,778
1 vote
2 answers
1k views

how do I copy or create a new pdf file without password-protection?

Sometimes I get password-protected pdf files from people with passwords in the mail. It becomes a pain to remember them. The pdf file are usually version 1.4 documents, this information I am sharing ...
shirish's user avatar
  • 12.5k
2 votes
1 answer
631 views

"Place" Letter Sized PDF to Larger pdf at specific position

Lulu is a print on-demand service. Part of the creation process is to upload a cover. The "cover" is 1 page that has the dimensions 17.25 inches wide by 11.25 inches high. There is a 0.125 "bleed area"...
Ra is dead's user avatar
3 votes
0 answers
1k views

What tool can be used to change the orientation of a pdf page without using the `Rotate` key value?

On page 78 of the PDF Specification 2008, it mentions that the PDF's page object has an integer key value Rotate that you can set to tell the software how the page should be displayed. This value ...
hzh's user avatar
  • 631
1 vote
1 answer
572 views

Merge content of PDF pages from command line without pdftk

I have two PDF files, each has the same number of pages. I want a PDF file with the same number of pages, and each page is a superimposition of the pages of the same number in the two source files. As ...
Mikhail Ramendik's user avatar
1 vote
0 answers
83 views

PDFtk on RHEL 5.6

My colleagues and I are trying to install PDFtk on a RHEL 5.6 server. PDFtk requires libgcj which is installed, but an older version (v4.1.2) When we install PDFtk and try to add a password to a PDF ...
egas's user avatar
  • 11
0 votes
0 answers
820 views

Delete/add/replace pages in PDF while preserving bookmarks [duplicate]

Is there an easy CLI method to do that? If I use pdftk, I get a new pdf without the bookmarks of the original one. The bookmarks were created on another system with Adobe Acrobat Pro, and an example ...
evb's user avatar
  • 163
9 votes
3 answers
4k views

How to concatenate pdf files with different frame sizes

For concatenating presentations of the same topic I use pdftk (e. g. pdftk stones\ in\ england.pdf stones\ from\ namibia.pdf cat output nice\ stones.pdf). Files with diferent frame sizes but same ...
Nepumuk's user avatar
  • 709
1 vote
2 answers
2k views

Is there a convenient way to insert blank pdf pages into my pdf?

I have a pdf file foo.pdf. I want to create a pdf file foo-blankbacks.pdf whose odd pages are the pages of foo.pdf and whose even pages are blank. Can this be easily accomplished from the command line?...
Brian Fitzpatrick's user avatar
2 votes
1 answer
654 views

pdftk can't handle emdashes in filenames

I'm trying to use pdftk (v 1.40) to combine some pdfs (using it's cat command). As a simple test, I can do pdftk "/home/deploy/Foo - Bar.pdf" cat output results.pdf and that works fine (I'm only ...
Max Williams's user avatar
  • 1,117
0 votes
1 answer
289 views

lp add file-path to pdf

Is there an easy way how to add a filepath (or a string) to a printed pdf using lp, convert, pdftk, python or friends? I want to print a bunch of pdf files with watermarks/headers which are parts of ...
kyticka's user avatar
  • 101
3 votes
1 answer
2k views

How to display bookmarks in the initial view when opening a PDF file?

I'm looking for a way to modify an existing pdf file so that the bookmarks panel opens automatically (on the right hand side) when I open the pdf file in acrobat reader or another reader. In https://...
carbontracking's user avatar
0 votes
1 answer
419 views

Avoid temp-file when adding a property to a PDF file in bash script

The following script makes use of a temporary file "data.txt" to which something is appended before reusing it. (Actually I simply add some metadata to a PDF) #!/bin/bash PDFTK="/app/bin/pdftk" #...
Bastl's user avatar
  • 135
189 votes
10 answers
161k views

Command line: How do you rotate a PDF file 90 degrees?

When I scan documents that are landscape-oriented, the output PDF files are portrait and so all the PDF viewers display the scanned documents in portrait. From the command line, how do you rotate a ...
Trevor Boyd Smith's user avatar
8 votes
4 answers
2k views

How to pdftk end minus 1?

I want to exctact pages from a pdf document such that all pages are extracted except the first one and the last one. Code but (end-1) does not work, nor 2-end-1 pdftk 1.pdf cat 2-(end-1) output ...
Léo Léopold Hertz 준영's user avatar
4 votes
1 answer
765 views

How to turn a text pdf into picture pdf?

How to transform a pdf with text into a "picture pdf", that is, a pdf based on pictures in one single command? I can obviously run multiple commands to do it but I am sure there is a straightest way ...
user123456's user avatar
  • 5,088
1 vote
1 answer
679 views

Escape whitespace in find for pdftk without xargs -J

I'd like to concatenate all PDFs in subdirectories, with filenames potentially containing whitespaces. I am well aware of this solution, find . -name *.pdf -print0 | xargs -0 -J FILE pdftk FILE cat ...
user32849's user avatar
  • 151
2 votes
0 answers
2k views

Manual install of pdftk can't find libgcj library

I'm trying to get pdftk running on my shared hosting account (no root access). I followed the instructions here, mainly: $ mkdir -p [my_project]/vendor/pdftk/lib [my_project]vendor/pdftk/bin $ cd /...
esther h's user avatar
  • 243
1 vote
0 answers
41 views

How to merge pages of a pdf from the command line [duplicate]

From a pdf of n pages, how to reduce by half the number of pages by merging several pages on a single page? Each pair of pages from the old pdf should be found side by side on the new pdf.
Remi.b's user avatar
  • 1,193
5 votes
3 answers
2k views

pdfimages wont extract all images

I'm using pdfimages to extract images from a PDF File. I've counted at last 10 images. But the program will only extract 4. pdfimages -all file.pdf i Generates -rw-rw-r-- 1 victor victor 61389 ...
Victor Ribeiro's user avatar
7 votes
3 answers
19k views

Proper way to convert PDF to word from bash command-line

I need to convert 1K pdf files to doc on a debian server. I can convert a PDF to word using libreoffice commandline: libreoffice --headless --invisible --convert-to doc Sample-doc-file-100kb.pdf Or ...
user2972081's user avatar