Q: I want to setup a PDF document so that it starts printing, as soon as it is opened, using JavaScript. Is it possible to do so in PDF Studio?

A: To print the PDF on opening, you will need to add an open JavaScript action to the PDF document.

Follow the steps below:

  1. Go to Document Properties
  2. Click JavaScript tab
  3. Select Add
  4. Type the following JavaScript
this.print({bUI:true,bShrinkToFit:true,nStart:1,nEnd:3,bAnnotations:false});

javascript (2)

Select OK.

The next time this PDF document is open, it should start printing immediately, assuming JavaScript is enabled (under Edit->Preferences->JavaScript).

Tagged: