Score:1

Add watermark to all PDF pages

cn flag

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

Score:4
us flag

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.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.