Add watermark to all PDF pages

Please tell me how to use the command line correctly in this case. And so the task, there are a lot of pdf files on all pages of these files I need to add a watermark. I made watermark in pdf and it works. I have already used pdftk, but only for one file, that is, when we open the terminal in the directory and enter - "pdftk original.pdf multistamp link.pdf output final.pdf" Everything works fine for one file. PdfChain - I also tried it, there is also no way to process several files at a time from a folder.

But how to do with it if I have 1000 files in the directory, what should I do in this case? What should the command look like in the terminal? I did not find anything in the manual. Thanks


Use the following command

for i in *.pdf; do pdftk "$i" multistamp link.pdf output "${i%.pdf}"-final.pdf; done

It takes each pdf file (let's say, filename.pdf), and applies the stamp, and saves it to filename-final.pdf.