I want to use pdftk
to merge all pdffiles in a directory and all of its subdirectories. I cannot find a --recursive option in the man pages.
Doing this manually (using a GUI) is not an option as it would be too much work.
Any suggestions?
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It only takes a minute to sign up.
Sign up to join this communityI don't think this is ideal, but you could:
cp all the pdf files of the subdirectories into one directory.
mkdir all-in-one
find SomeDirectory -iname '*.pdf' -exec cp {} all-in-one/
concatenate them
cd all-in-one
pdftk *.pdf output output.pdf
The disadvantage of this solution is that you have to copy all the files.
This doesn't like file names that include spaces, but it seemed to work for a couple files in two different directories. That is a back quote (same key as the tilde character) surrounding the find|xargs pipeline.
pdftk `find . -name *.pdf -print|xargs echo` cat output out.pdf