Copy link to clipboard
Copied
Hello I have a simple question.
Does can insert numbers counters.
a form that gives each opening a new number.
Example: I open the PDF and it is noted: 00055. Then I make a further application, number 00056
Copy link to clipboard
Copied
Do you mean that the number will change each time you open the form? Yes, it can be done using a form field and a simple script.
Copy link to clipboard
Copied
yes every time and when we erases
You mean what by simple script...
Copy link to clipboard
Copied
Let's say you have a text field called Counter. In Acrobat, go to Tools - JavaScript - Document JavaScripts and create a new item (call it "scripts"), with this code:
var f = this.getField("Counter");
f.value = util.printf("%05d", Number(f.valueAsString)+1);
Click OK and save the file. Each time you open if from that point on, the value of Counter will increment by one.
Copy link to clipboard
Copied
This is really helpfull.
Which version of Acrobat do we need?
I know it is not the Reader version
Copy link to clipboard
Copied
You need Acrobat Pro to have access to the doc-level scripts.
Copy link to clipboard
Copied
Thank you very much!
That's very nice and appreciated.
Have a good day.
Copy link to clipboard
Copied
Hello,
Thank you, it works. But, another question.
Since the pdf will be hosted online and downloaded, is it possible to add a Ajax call to increment the value?
If so, can you send us a code snippet of this to give us an exemple?
Copy link to clipboard
Copied
No, you can't use Ajax in PDF files.
Copy link to clipboard
Copied
OK I understand.
How does one ensure that the PDF will be different every time.
Knowing that many people can download or complete online at the same time?
Copy link to clipboard
Copied
- Fill in the numbers on your end, instead of on the user's end.
- Use a random or time-based number instead of an incremental one.
Copy link to clipboard
Copied
Thank you for your help
We will try.
Do you work for ADOBE?
Have a nice day
Copy link to clipboard
Copied
No, I don't.
On Mar 9, 2016 4:40 PM, "j-francoisp52431786" <forums_noreply@adobe.com>
Find more inspiration, events, and resources on the new Adobe Community
Explore Now