Include input file name in output option

18 Views Asked by At

I'm trying to burst multiple files in one go and would like to include the input filename and page number as the output. Something like:

pdftk *.pdf burst output source_filename.%2d.pdf

Any ideas.

If I do

pdftk *.pdf burst 

I just get an error "Input errors, so no output created."

1

There are 1 best solutions below

1
CatWazel67 On

After more googling and experimentation this works:

for file in *.pdf; do pdftk "$file" burst output "${file%.pdf}-%02d.pdf"; done