Skip to main content
Participant
January 5, 2022
Answered

watermark on every fixed number of pages

  • January 5, 2022
  • 1 reply
  • 1551 views

 

I would like to insert a watermark on my pdf document every fixed number of pages (ex. every 5th page).  However, there is currently only the option to select a range of pages or every odd or even page.  

 

Having this feature would be very useful to me as my resources are 200-300 pages, the watermarks are distracting, and for security purposes not necessary to have on every page.  I'm hoping this feature can be developed soon.

 

 

 

Thanks.

This topic has been closed for replies.
Correct answer RK20

I usually charge for private consultation sessions. If you're interested you can contact me via [try6767 at gmail.com].

 

You can learn here how to use the JS Console:

https://acrobatusers.com/tutorials/javascript_console

 


FYI for others that encounter this, try67 via email explained to insert the code "you just need to press Ctrl+J, paste the code into the window, select it all and then press Ctrl+Enter." And this worked and the code worked.

1 reply

try67
Community Expert
Community Expert
January 5, 2022

 This can be achieved using a custom-made script.

Do you want to use an image, or text? Where should it appear, and what should it look like?

RK20Author
Participant
January 7, 2022

Thanks. I want it to appear on the top of the page, text and I've attached a sample of what I would like it to look like. The water mark is on the top left corner.

try67
Community Expert
Community Expert
January 7, 2022

Try this code:

 

var watermarkText = "Purchased by A Smith January 7, 2022";
for (var p=0; p<this.numPages; p++) {
	if (p==0 || p%5==4)
		this.addWatermarkFromText({nStart: p, cText: watermarkText, cFont: "Arial", nFontSize: 8, nHorizAlign: app.constants.align.left, nVertAlign: app.constants.align.top, nHorizValue: 14, nVertValue: -24});
}