Copy link to clipboard
Copied
Hi. I am using InDesign CC 2018 and Acrobat Pro DC.
I would like to have a watermark on my .pdf that shows the current date. I'd want it to update to the current date each time it is opened..(like how a Word document does so with letterheads, etc.) The date would be in the background on a price list document.
First of all, should I do this in Acrobat or InDesign? Not sure if possible. I see there are separate programs or plugins, but thought Acrobat would have something available.
Thank you.
You should do it in Acrobat. Create a text field. Let's say it's called "Today".
Then go to Tools - JavaScript - Document JavaScripts and create a new item. Let's call it "scripts".
Enter this code into the editor window that opens:
this.getField("Today").value = util.printd("dd/mm/yyyy", new Date());
Save the file and you're done.
Copy link to clipboard
Copied
You should do it in Acrobat. Create a text field. Let's say it's called "Today".
Then go to Tools - JavaScript - Document JavaScripts and create a new item. Let's call it "scripts".
Enter this code into the editor window that opens:
this.getField("Today").value = util.printd("dd/mm/yyyy", new Date());
Save the file and you're done.
Copy link to clipboard
Copied
Can the text field be from the Comments in Tools or do I have to treat this pdf like a form?
Copy link to clipboard
Copied
It's possible to do it with a comment, but it requires a more complex script. Use a form field.
Copy link to clipboard
Copied
Thank you. The text field is blank after saving so I have to figure out what I am doing wrong yet.
Copy link to clipboard
Copied
It will only update the next time you open the file.
Copy link to clipboard
Copied
I've closed it and reopened and closed Acrobat and reopened the file, still blank.
I even tried going to the text fields properties and clicking Format and trying to add the JavaScript there, but it won't seem to let me. Keeps reverting to None even if I close the program and try again or even try on another computer.
Copy link to clipboard
Copied
Press Ctrl+J and check for error messages. If there are none then you'll need to share the file with us (via Dropbox, Google Drive, etc.) for additional help with this.
Copy link to clipboard
Copied
Good news: no errors
Even better news: it works now!
I made the color of the text a light gray. Is there a way to make the text transparent? I couldn't find the option under Properties..
Copy link to clipboard
Copied
No, it can't be transparent.
Copy link to clipboard
Copied
That is unfortunate . I don't think I can use this then. I have a lot of small text that would make that area hard to read with the date over it. However, it is good to know this is possible.
Copy link to clipboard
Copied
I don't understand what you're trying to achieve. Why add text and then make it transparent? Is it so that you could later search for it, but you don't want the user to see it? If so, just make the field hidden.
Copy link to clipboard
Copied
Because it is covering the text and you can't read that area. The whole page is covered in text. There isn't much white space. The date has to be large, 48 pt across the middle of the page. I would want the text behind to seep through.
We want the user to be able to see the date.
Copy link to clipboard
Copied
In that case you will need to use either a comment or a watermark, but those are more difficult to script, as I've said.
Copy link to clipboard
Copied
okay thanks. I will look into how to create a watermark with the Comments..