Skip to main content
Participant
January 23, 2020
Answered

Repeat action

  • January 23, 2020
  • 1 reply
  • 1559 views

Is there a way to repeat an action in the action wizard?  I am just trying to set it up so that it prints the same open file repeatedly.

 

Thanks in advance for any help.

This topic has been closed for replies.
Correct answer Thom Parker

Thank you so much for your responses!

 

Yes, I meant to say javaScript, not html.  We have a "litho" number that marks each page of a document (the document is a questionnaire for people to fill out).  We want each printed copy of that document to have a unique litho number, so the java script we currently have does that, but it just automatically makes the litho go up a number every time you print, but we need like 10,000 copies and don't want to sit there and hit print 10,000 times in a row.

 

Here is the javaScript for the litho:

 

this.getField("Litho").value = util.printf("%04d", Number(this.getField("Litho").value)+1);

 

I am unfamiliar with Javascript to add a command to keep printing.  Any guidance you could provide.

 

Again, I really appreciate your time and your help so far.


The easy thing to do is to write a short piece of code in the console window

 

for(var i=0;i<1000;i++)

     this.print(false);

 

The print command can get a lot fancier.  Here's the reference entry:

https://help.adobe.com/en_US/acrobat/acrobat_dc_sdk/2015/HTMLHelp/#t=Acro12_MasterBook%2FJS_API_AcroJS%2FPrintParams_properties.htm

 

There's a tutorial on using the console window here:

https://www.pdfscripting.com/public/Free_Videos.cfm#JSIntro

 

You don't really need to code in the text field, since the process is already being automated on the console the number code could be integrated into the loop. In fact if you need to do this process often, it would be worthwhile to create an automation script. Here's some material on doing that:

 

https://www.pdfscripting.com/public/Automating-Acrobat.cfm

1 reply

Thom Parker
Community Expert
Community Expert
January 23, 2020

Why not just print multiple copies?

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
Participant
January 24, 2020

There's an html code built into the file that adds sequential numbers to the bottom of the document everytime the file is printed -- like a ticket counter thing -- <print> 0001 <print> 0002 <print> 0003, etc. So, I just need the action wizard to just keep printing repeatedly.  Is there a way to do that?

Thom Parker
Community Expert
Community Expert
January 24, 2020

No, but why not just move your Action code to an automation script to do this? 

If you have Acrobat DC, there is this thing called Commands on the ActionWizard panel. It's basically an automation tool. 

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often