I'd like to insert a PDF as a watermark on odd page numbers in a specific page range of another PDF. My problem with the code below is that the loop doesn't work. The watermark is always inserted on all pages of my target PDF (all 600 pages). Even if I replace the variables with fixed numbers, the watermark appears on all 600 pages.

I have to say, that I'm a beginner regarding JavaScript. Here's my code: