Copy link to clipboard
Copied
I am wanting to store a batch of pdfs. I want to place on each document a visible annotation or label showing its file name and a unique number or barcode. How can this be done? Thank you.
Copy link to clipboard
Copied
The simplest way to create a unique number would be the date at the time the file is saved. The JavaScript Date object has the getTime() function, which displays the number of milliseconds since a reference date (which, I think, is January 1st, 1990, midnight). Of that number, one could, for example, just take the last 10 or so digits, to keep the number readable.
When you apply the stamp, you will therefore need a little script:
var myID = new Date().getTime() ;
(as a base), and then use the variable as value for the stamp.
It would also be possible to create a field for that information, and (if there are no other Annotations (fields, comments, links, etc.) in the document, flatten them after filling). Or, the Watermark function would work as well.
The trigger event would be willSave.