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

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

Community Beginner ,
Oct 07, 2016 Oct 07, 2016

example.jpg

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.

TOPICS
Acrobat SDK and JavaScript , Windows
1.7K
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

correct answers 1 Correct answer

Community Expert , Oct 09, 2016 Oct 09, 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));

Translate
Community Expert ,
Oct 08, 2016 Oct 08, 2016

Do you want it to be a random number, or a sequential 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 ,
Jan 11, 2018 Jan 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.

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 ,
Jan 11, 2018 Jan 11, 2018
LATEST

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

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 Beginner ,
Oct 08, 2016 Oct 08, 2016

Example. 00000001 (Secuencial)

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 ,
Oct 09, 2016 Oct 09, 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));

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 Beginner ,
Oct 09, 2016 Oct 09, 2016

Works great!!!!!! Thanks try67​

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 Beginner ,
Oct 09, 2016 Oct 09, 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

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 ,
Oct 09, 2016 Oct 09, 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.

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 Beginner ,
Oct 10, 2016 Oct 10, 2016

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

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