Skip to main content
Participant
October 7, 2016
Answered

I want to create a billing invoice number in acrobat field each time I open a pdf. How can I do that?

  • October 7, 2016
  • 4 replies
  • 1747 views

This is the area that I want the numbers. Each time I open the pdf document create a different billing number. I think that the code is in Javascript but I don't know.

I'm going to use 10 digits. Where I place the code?

Thanks for your help.

This topic has been closed for replies.
Correct answer try67

Go to Tools - JavaScript - Document JavaScripts, create there a new item called "scripts", and then paste this code into the window that opens:

this.getField("WORK ORDER").value = util.printf("%010d", (Number(this.getField("WORK ORDER").value) + 1));

4 replies

Participant
October 10, 2016

Thanks try67​ for your support. I appreciate that.  Thumbs up

Participant
October 9, 2016

Another ? try67​. I test it and works fine. when I open the document, I need save it first before complete all the information or save as like a new document?

Thks

try67
Community Expert
Community Expert
October 9, 2016

Not sure what you mean... If you want the document to automatically save when you open it (after the invoice number is changed, I assume) then that is possible, but it requires installing a script on the local machine.

Participant
October 9, 2016

Example. 00000001 (Secuencial)

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
October 9, 2016

Go to Tools - JavaScript - Document JavaScripts, create there a new item called "scripts", and then paste this code into the window that opens:

this.getField("WORK ORDER").value = util.printf("%010d", (Number(this.getField("WORK ORDER").value) + 1));

Participant
October 9, 2016

Works great!!!!!! Thanks try67

try67
Community Expert
Community Expert
October 8, 2016

Do you want it to be a random number, or a sequential one?

Participant
January 11, 2018

What code can I use to have sequential numbers beginning with a specific number like 2018-IN-20000, next number being 2018-IN-20001? Thank for any help.

Participant
January 11, 2018

instead of "WORK ORDER" for the field id its "DOCKET NO" thanks