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

numbers counters

New Here ,
Mar 04, 2016 Mar 04, 2016

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

TOPICS
Acrobat SDK and JavaScript , Windows
753
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 ,
Mar 04, 2016 Mar 04, 2016

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.

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
New Here ,
Mar 04, 2016 Mar 04, 2016

yes every time and when we erases

You mean what by simple script...

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 ,
Mar 04, 2016 Mar 04, 2016

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.

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
New Here ,
Mar 04, 2016 Mar 04, 2016

This is really helpfull.

Which version of Acrobat do we need?

I know it is not the Reader version

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 ,
Mar 04, 2016 Mar 04, 2016

You need Acrobat Pro to have access to the doc-level scripts.

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
New Here ,
Mar 04, 2016 Mar 04, 2016

Thank you very much!

That's very nice and appreciated.

Have a good day.

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
New Here ,
Mar 09, 2016 Mar 09, 2016

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?

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 ,
Mar 09, 2016 Mar 09, 2016

No, you can't use Ajax in PDF files.

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
New Here ,
Mar 09, 2016 Mar 09, 2016

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?

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 ,
Mar 09, 2016 Mar 09, 2016

- 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.

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
New Here ,
Mar 09, 2016 Mar 09, 2016

Thank you for your help

We will try.

Do you work for ADOBE?

Have a nice day

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 ,
Mar 09, 2016 Mar 09, 2016
LATEST

No, I don't.

On Mar 9, 2016 4:40 PM, "j-francoisp52431786" <forums_noreply@adobe.com>

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