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

Printing Sequential Invoice Numbers

New Here ,
May 25, 2018 May 25, 2018

Copy link to clipboard

Copied

I have a form that I want to print sequential invoice numbers. Example: Invoice Number 601541 prints, then Invoice Number 601542 prints, and so on. I want to be able to just click the amount of copies and have it print like that.  Any javascript suggestions?

TOPICS
Acrobat SDK and JavaScript

Views

205

Likes

Translate

Translate

Report

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 ,
May 25, 2018 May 25, 2018

Copy link to clipboard

Copied

It's possible, but would require a separate print command for each copy.

Let's say the field is called "Invoice". You run print the file like this 10 times with different values for it in each copy:

for (var i=1; i<=10; i++) {

     this.getField("Invoice").value = Number(this.getField("Invoice").value)+1;

     this.print({bSilent: true});

}

Likes

Translate

Translate

Report

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 ,
May 25, 2018 May 25, 2018

Copy link to clipboard

Copied

Separate print command? I can't just type in the number of copies and it print sequential numbers, like in excel?

And where does this code go? under document javascript or document actions?

Likes

Translate

Translate

Report

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 ,
May 25, 2018 May 25, 2018

Copy link to clipboard

Copied

LATEST

No, you can't.

Depends on how you want to execute it. A button or from the JS-console would be the best options.

Likes

Translate

Translate

Report

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