Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

watermark on every fixed number of pages

Community Beginner ,
Jan 05, 2022 Jan 05, 2022

 

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.

TOPICS
Edit and convert PDFs
1.4K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
1 ACCEPTED SOLUTION
Community Beginner ,
Jan 13, 2022 Jan 13, 2022

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.

View solution in original post

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 05, 2022 Jan 05, 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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jan 07, 2022 Jan 07, 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 07, 2022 Jan 07, 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});
}
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jan 07, 2022 Jan 07, 2022

Thanks!  how/where do I add the code?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 07, 2022 Jan 07, 2022

You can run it as a part of an Action or from the JS Console.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jan 07, 2022 Jan 07, 2022

I'm not familiar with this. Would it be possible for ut ot meet briefly via zoom so you can show me how. 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 07, 2022 Jan 07, 2022

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

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jan 13, 2022 Jan 13, 2022

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 13, 2022 Jan 13, 2022
LATEST

Watch the video here on using the Console Window:

https://www.pdfscripting.com/public/Free_Videos.cfm#JSIntro

 

 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines